34 lines
846 B
Go
34 lines
846 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 string `gorm:"type:varchar(256);uniqueIndex:idx_whitelist"`
|
|
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:"描述"`
|
|
|
|
CreatedAt time.Time `readonly:"true"`
|
|
}
|
|
|
|
func (lm *WhiteList) TableName() string {
|
|
return "whitelist"
|
|
}
|
|
|
|
func (m *WhiteList) GetId() int {
|
|
return m.ID
|
|
}
|
|
|
|
func (m *WhiteList) GetChoiceServers(projectId string) []*dto.CommonDtoFieldChoice {
|
|
return getChoiceServers(projectId)
|
|
}
|