uniugm/admin/apps/game/model/globalmail.go

35 lines
922 B
Go
Raw Normal View History

2025-04-24 20:39:31 +08:00
package model
import (
"admin/apps/game/model/dto"
"admin/internal/db"
"time"
)
func init() {
db.RegisterTableModels(GlobalMail{})
}
type GlobalMail struct {
ID int `gorm:"primarykey" readonly:"true"`
2025-04-30 15:46:14 +08:00
ProjectId int
2025-04-24 20:39:31 +08:00
ServerIDs []string `gorm:"type:json;serializer:json" name:"区服" type:"[]string" choices:"GetChoiceServers" multi_choice:"true"`
Title string `name:"邮件标题" required:"true"`
Content string `name:"邮件内容" required:"true"`
2025-05-04 22:07:13 +08:00
Attach []*MailAttachItem `gorm:"type:json;serializer:json" name:"邮件附件" type:"items" desc:"搜索道具并点击添加"`
2025-04-24 20:39:31 +08:00
2025-04-28 15:56:04 +08:00
CreatedAt time.Time `readonly:"true"`
2025-04-24 20:39:31 +08:00
}
func (lm *GlobalMail) TableName() string {
return "mail_global"
}
func (m *GlobalMail) GetId() int {
return m.ID
}
2025-04-30 15:46:14 +08:00
func (m *GlobalMail) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice {
return getChoiceServers(project)
2025-04-24 20:39:31 +08:00
}