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

34 lines
846 B
Go
Raw Permalink Normal View History

2025-04-24 20:39:31 +08:00
package model
import (
2025-04-28 15:56:04 +08:00
"admin/apps/game/model/dto"
2025-04-24 20:39:31 +08:00
"admin/internal/db"
"time"
)
func init() {
db.RegisterTableModels(WhiteList{})
}
type WhiteList struct {
2025-04-26 13:50:26 +08:00
ID int `gorm:"primarykey" readonly:"true"`
ProjectId string `gorm:"type:varchar(256);uniqueIndex:idx_whitelist"`
2025-04-28 15:56:04 +08:00
ServerConfID string `gorm:"type:varchar(200);uniqueIndex:idx_server" name:"区服id" required:"true" choices:"GetChoiceServers"`
Account string `gorm:"type:varchar(128);uniqueIndex:idx_whitelist" name:"账户" required:"true"`
Desc string `name:"描述"`
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 *WhiteList) TableName() string {
return "whitelist"
}
func (m *WhiteList) GetId() int {
return m.ID
}
2025-04-28 15:56:04 +08:00
func (m *WhiteList) GetChoiceServers(projectId string) []*dto.CommonDtoFieldChoice {
return getChoiceServers(projectId)
}