uniugm/admin/apps/game/model/whitelist.go
2025-05-05 10:30:33 +08:00

34 lines
851 B
Go

package model
import (
"admin/apps/game/model/dto"
"admin/internal/db"
"time"
)
func init() {
db.RegisterTableModels(WhiteList{})
}
type WhiteList struct {
ID int `gorm:"primarykey" readonly:"true"`
ProjectId int `gorm:"uniqueIndex:idx_whitelist"`
ServerConfID string `gorm:"type:varchar(200);uniqueIndex:idx_server" name:"区服id" required:"true" choices:"GetChoiceServers" where:"eq"`
Account string `gorm:"type:varchar(128);uniqueIndex:idx_whitelist" name:"账户" required:"true"`
Desc string `name:"描述"`
CreatedAt time.Time `readonly:"true" where:"range"`
}
func (lm *WhiteList) TableName() string {
return "whitelist"
}
func (m *WhiteList) GetId() int {
return m.ID
}
func (m *WhiteList) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice {
return getChoiceServers(project)
}