backend/pkg/notification/domain/entity/template.go

24 lines
906 B
Go

package entity
import "time"
// Template 通知模板實體
type Template struct {
ID string `bson:"_id" json:"id"`
Type string `bson:"type" json:"type"` // email/sms
Language string `bson:"language" json:"language"` // zh-tw, en
Category string `bson:"category" json:"category"` // forget_password, binding_email
Subject string `bson:"subject" json:"subject"` // 郵件主題 (SMS 可為空)
Body string `bson:"body" json:"body"` // 內容
IsActive bool `bson:"is_active" json:"is_active"`
CreatedAt time.Time `bson:"created_at" json:"created_at"`
UpdatedAt time.Time `bson:"updated_at" json:"updated_at"`
}
// TemplateParams 模板參數
type TemplateParams struct {
Username string `json:"username"`
VerifyCode string `json:"verify_code"`
Extra map[string]string `json:"extra"` // 額外參數
}