30 lines
738 B
Go
30 lines
738 B
Go
|
package model
|
||
|
|
||
|
import (
|
||
|
"admin/internal/db"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
db.RegisterTableModels(CDKeyUsed{})
|
||
|
}
|
||
|
|
||
|
type CDKeyUsed struct {
|
||
|
ID int `gorm:"primarykey" readonly:"true"`
|
||
|
ProjectId int `gorm:"index:idx_project_id"`
|
||
|
ServerID string `name:"所属区服" choices:"GetChoiceServers" required:"true" where:"eq"`
|
||
|
Account string `gorm:"type:varchar(255);index:idx_account"`
|
||
|
RoleID string `gorm:"type:varchar(255);index:idx_role_id"`
|
||
|
RoleName string `gorm:"type:varchar(255)"`
|
||
|
Key string `gorm:"type:varchar(255);index:idx_key"`
|
||
|
CreatedAt time.Time `readonly:"true"`
|
||
|
}
|
||
|
|
||
|
func (lm *CDKeyUsed) TableName() string {
|
||
|
return "cdkey_used"
|
||
|
}
|
||
|
|
||
|
func (m *CDKeyUsed) GetId() int {
|
||
|
return m.ID
|
||
|
}
|