34 lines
995 B
Go
34 lines
995 B
Go
package model
|
||
|
||
import (
|
||
"admin/internal/db"
|
||
"admin/internal/model/dto"
|
||
"time"
|
||
)
|
||
|
||
func init() {
|
||
db.RegisterTableModels(Account{})
|
||
}
|
||
|
||
// Account 空表,就是用来兼容资源增删改查公共操作的,实际列举账号等都是走各个项目api拉取
|
||
type Account struct {
|
||
ProjectId int `gorm:"index:idx_project_id"`
|
||
ServerConfId string `name:"区服id" json:"serveId" choices:"GetServerConfIDChoices" where:"eq"`
|
||
Account string `name:"账号" json:"account" where:"eq"`
|
||
RoleIds []string `gorm:"type:json;serializer:json" name:"角色id列表" json:"roleIds"`
|
||
LatestLoginTime time.Time `name:"最近登录时间" json:"latest_login_time"`
|
||
CreatedAt time.Time `name:"创建时间" json:"create_time"`
|
||
}
|
||
|
||
func (lm *Account) TableName() string {
|
||
return "account"
|
||
}
|
||
|
||
func (m *Account) GetId() int {
|
||
return 0
|
||
}
|
||
|
||
func (m *Account) GetServerConfIDChoices(project *Project) []*dto.CommonDtoFieldChoice {
|
||
return getChoiceServers(project)
|
||
}
|