You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package admin
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
|
|
type Admin struct {
|
|
|
|
|
Id uint64 `xorm:"pk autoincr 'id'" `
|
|
|
|
|
Username string `xorm:"varchar(50) notnull unique 'username'"`
|
|
|
|
|
Phone string `xorm:"varchar(60) unique 'phone'" `
|
|
|
|
|
// 密码相关
|
|
|
|
|
Password string `xorm:"varchar(60) notnull 'password'" ` // 使用 bcrypt 加密存储,长度60
|
|
|
|
|
Salt string `xorm:"varchar(32) notnull 'salt'" ` // 密码加密盐值
|
|
|
|
|
// 状态相关
|
|
|
|
|
Status int8 `xorm:"tinyint(1) default 1 'status'" `
|
|
|
|
|
Roles []string
|
|
|
|
|
// 登录相关
|
|
|
|
|
LastLoginTime *time.Time `xorm:"datetime 'last_login_time'" `
|
|
|
|
|
LastLoginIp string `xorm:"varchar(50) 'last_login_ip'"`
|
|
|
|
|
// 时间相关
|
|
|
|
|
CreatedAt time.Time `xorm:"datetime created 'created_at'" `
|
|
|
|
|
UpdatedAt time.Time `xorm:"datetime updated 'updated_at'"`
|
|
|
|
|
DeletedAt time.Time `xorm:"datetime deleted 'deleted_at'" `
|
|
|
|
|
}
|