38 lines
995 B
Go
38 lines
995 B
Go
package model
|
|
|
|
import (
|
|
"admin/internal/db"
|
|
"admin/internal/model/dto"
|
|
"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"`
|
|
UpdatedAt time.Time `readonly:"true"`
|
|
}
|
|
|
|
func (lm *SupportAccount) TableName() string {
|
|
return "support_account"
|
|
}
|
|
|
|
func (m *SupportAccount) GetId() int {
|
|
return m.ID
|
|
}
|
|
|
|
func (m *SupportAccount) GetShowKey() string {
|
|
return m.Account
|
|
}
|
|
|
|
func (m *SupportAccount) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice {
|
|
return getChoiceServers(project)
|
|
}
|