uniugm/admin/apps/game/model/support_account.go
2025-08-20 17:41:19 +08:00

39 lines
1.1 KiB
Go

package model
import (
"admin/internal/db"
"admin/internal/model/dto"
"time"
)
func init() {
db.RegisterTableModels(SupportAccount{})
}
type SupportAccount struct {
ID int `gorm:"primarykey" readonly:"true"`
ProjectId int `gorm:"uniqueIndex:idx_account"`
//ServerConfID string `gorm:"type:varchar(200);uniqueIndex:idx_account;index:idx_server" name:"区服id" required:"true" choices:"GetChoiceServers" where:"eq"`
Account string `gorm:"type:varchar(200);uniqueIndex:idx_account;" name:"账号" desc:"用逗号标记多个" required:"true"`
Channel string `name:"渠道" desc:"渠道名,用于后台统计分析归类" required:"true"`
CreatedAt time.Time `readonly:"true" where:"range"`
UpdatedAt time.Time `readonly:"true"`
}
func (lm *SupportAccount) TableName() string {
return "support_account"
}
func (m *SupportAccount) GetId() int {
return m.ID
}
func (m *SupportAccount) GetShowKey() string {
return m.Account
}
func (m *SupportAccount) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice {
return getChoiceServers(project)
}