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

35 lines
934 B
Go
Raw Normal View History

2025-07-04 15:24:46 +08:00
package model
import (
"admin/internal/db"
"admin/internal/model/dto"
"time"
)
func init() {
db.RegisterTableModels(GenAccount{})
}
type GenAccount struct {
ID int `gorm:"primarykey" readonly:"true"`
2025-07-09 10:55:26 +08:00
ProjectId int `gorm:"index"`
ServerConfID string `gorm:"type:varchar(200);index:idx_server" name:"区服id" required:"true" choices:"GetChoiceServers" where:"eq"`
2025-07-04 15:24:46 +08:00
AccountNum int `name:"账号数量" readonly:"true"`
AccountList string `gorm:"type:longtext" name:"账号列表" type:"randAccount" desc:"用逗号标记多个" required:"true" big_column:"true"`
CreatedAt time.Time `readonly:"true" where:"range"`
UpdatedAt time.Time `readonly:"true"`
}
func (lm *GenAccount) TableName() string {
return "gen_account"
}
func (m *GenAccount) GetId() int {
return m.ID
}
func (m *GenAccount) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice {
return getChoiceServers(project)
}