32 lines
1.3 KiB
Go
32 lines
1.3 KiB
Go
package models
|
||
|
||
import (
|
||
"time"
|
||
|
||
"platform/web/core"
|
||
"platform/web/globals/orm"
|
||
)
|
||
|
||
// Admin 管理员表
|
||
type Admin struct {
|
||
core.Model
|
||
Username string `json:"username" gorm:"column:username"` // 用户名
|
||
Password string `json:"password" gorm:"column:password"` // 密码
|
||
Name *string `json:"name,omitempty" gorm:"column:name"` // 真实姓名
|
||
Avatar *string `json:"avatar,omitempty" gorm:"column:avatar"` // 头像URL
|
||
Phone *string `json:"phone,omitempty" gorm:"column:phone"` // 手机号码
|
||
Email *string `json:"email,omitempty" gorm:"column:email"` // 邮箱
|
||
Status AdminStatus `json:"status" gorm:"column:status"` // 状态:0-禁用,1-正常
|
||
LastLogin *time.Time `json:"last_login,omitempty" gorm:"column:last_login"` // 最后登录时间
|
||
LastLoginIP *orm.Inet `json:"last_login_ip,omitempty" gorm:"column:last_login_ip"` // 最后登录地址
|
||
LastLoginUA *string `json:"last_login_ua,omitempty" gorm:"column:last_login_ua"` // 最后登录代理
|
||
}
|
||
|
||
// AdminStatus 管理员状态枚举
|
||
type AdminStatus int
|
||
|
||
const (
|
||
AdminStatusDisabled AdminStatus = 0 // 禁用
|
||
AdminStatusEnabled AdminStatus = 1 // 正常
|
||
)
|