feat(1.0):新增是否为管理员

This commit is contained in:
summer 2025-10-17 11:44:13 +08:00
parent 59a91064a2
commit 86ab51f380
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ type admin struct {
Nickname field.String // 昵称 Nickname field.String // 昵称
Mobile field.String // 手机号 Mobile field.String // 手机号
Password field.String // 密码 Password field.String // 密码
IsSuper field.Int32 // 是否为超管(1:是 -1:否) IsSuper field.Int32 // 是否为超管(1:是 0:否)
LoginStatus field.Int32 // 登录状态(1:启用 0:禁用) LoginStatus field.Int32 // 登录状态(1:启用 0:禁用)
LastLoginTime field.Time // 最后一次登录时间 LastLoginTime field.Time // 最后一次登录时间
LastLoginIP field.String // 最后一次登录IP LastLoginIP field.String // 最后一次登录IP

View File

@ -17,7 +17,7 @@ type Admin struct {
Nickname string `gorm:"column:nickname;not null;comment:昵称" json:"nickname"` // 昵称 Nickname string `gorm:"column:nickname;not null;comment:昵称" json:"nickname"` // 昵称
Mobile string `gorm:"column:mobile;not null;comment:手机号" json:"mobile"` // 手机号 Mobile string `gorm:"column:mobile;not null;comment:手机号" json:"mobile"` // 手机号
Password string `gorm:"column:password;not null;comment:密码" json:"password"` // 密码 Password string `gorm:"column:password;not null;comment:密码" json:"password"` // 密码
IsSuper int32 `gorm:"column:is_super;not null;comment:是否为超管(1:是 -1:否)" json:"is_super"` // 是否为超管(1:是 -1:否) IsSuper int32 `gorm:"column:is_super;not null;comment:是否为超管(1:是 0:否)" json:"is_super"` // 是否为超管(1:是 0:否)
LoginStatus int32 `gorm:"column:login_status;not null;default:1;comment:登录状态(1:启用 0:禁用)" json:"login_status"` // 登录状态(1:启用 0:禁用) LoginStatus int32 `gorm:"column:login_status;not null;default:1;comment:登录状态(1:启用 0:禁用)" json:"login_status"` // 登录状态(1:启用 0:禁用)
LastLoginTime time.Time `gorm:"column:last_login_time;not null;default:CURRENT_TIMESTAMP;comment:最后一次登录时间" json:"last_login_time"` // 最后一次登录时间 LastLoginTime time.Time `gorm:"column:last_login_time;not null;default:CURRENT_TIMESTAMP;comment:最后一次登录时间" json:"last_login_time"` // 最后一次登录时间
LastLoginIP string `gorm:"column:last_login_ip;not null;comment:最后一次登录IP" json:"last_login_ip"` // 最后一次登录IP LastLoginIP string `gorm:"column:last_login_ip;not null;comment:最后一次登录IP" json:"last_login_ip"` // 最后一次登录IP