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

33 lines
889 B
Go
Raw Normal View History

2025-05-09 18:28:15 +08:00
package model
import (
"admin/apps/game/model/dto"
"admin/internal/db"
"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"`
CreatedAt time.Time `readonly:"true" where:"range"`
}
func (lm *SupportAccount) TableName() string {
return "support_account"
}
func (m *SupportAccount) GetId() int {
return m.ID
}
func (m *SupportAccount) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice {
return getChoiceServers(project)
}