添加用户的冻结功能

This commit is contained in:
king
2022-06-21 22:18:06 +08:00
parent 6321564bed
commit 1e6dfbff96
5 changed files with 51 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ type Register struct {
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
HeaderImg string `json:"headerImg" gorm:"default:'https://qmplusimg.henrongyi.top/gva_header.jpg'"`
AuthorityId string `json:"authorityId" gorm:"default:888"`
Enable int `json:"enable"`
AuthorityIds []string `json:"authorityIds"`
}
@@ -46,5 +47,6 @@ type ChangeUserInfo struct {
Email string `json:"email" gorm:"comment:用户邮箱"` // 用户邮箱
HeaderImg string `json:"headerImg" gorm:"default:https://qmplusimg.henrongyi.top/gva_header.jpg;comment:用户头像"` // 用户头像
SideMode string `json:"sideMode" gorm:"comment:用户侧边主题"` // 用户侧边主题
Enable int `json:"enable" gorm:"comment:冻结用户"` //冻结用户
Authorities []model.SysAuthority `json:"-" gorm:"many2many:sys_user_authority;"`
}

View File

@@ -18,8 +18,9 @@ type SysUser struct {
AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"`
Phone string `json:"phone" gorm:"comment:用户手机号"` // 用户手机号
Email string `json:"email" gorm:"comment:用户邮箱"` // 用户邮箱
Phone string `json:"phone" gorm:"comment:用户手机号"` // 用户手机号
Email string `json:"email" gorm:"comment:用户邮箱"` // 用户邮箱
Enable int `json:"enable" gorm:"default:1;comment:用户是否被冻结 1正常 2冻结"` //用户是否被冻结 1正常 2冻结
}
func (SysUser) TableName() string {