sys_user.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package request
  2. import model "log-server/model/system"
  3. // User register structure
  4. type Register struct {
  5. Username string `json:"userName"`
  6. Password string `json:"passWord"`
  7. NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
  8. HeaderImg string `json:"headerImg" gorm:"default:'https://qmplusimg.henrongyi.top/gva_header.jpg'"`
  9. AuthorityId uint `json:"authorityId" gorm:"default:888"`
  10. Enable int `json:"enable"`
  11. AuthorityIds []uint `json:"authorityIds"`
  12. }
  13. // User login structure
  14. type Login struct {
  15. Username string `json:"username"` // 用户名
  16. Password string `json:"password"` // 密码
  17. Captcha string `json:"captcha"` // 验证码
  18. CaptchaId string `json:"captchaId"` // 验证码ID
  19. }
  20. // Modify password structure
  21. type ChangePasswordStruct struct {
  22. Username string `json:"username"` // 用户名
  23. Password string `json:"password"` // 密码
  24. NewPassword string `json:"newPassword"` // 新密码
  25. }
  26. // Modify user's auth structure
  27. type SetUserAuth struct {
  28. AuthorityId uint `json:"authorityId"` // 角色ID
  29. }
  30. // Modify user's auth structure
  31. type SetUserAuthorities struct {
  32. ID uint
  33. AuthorityIds []uint `json:"authorityIds"` // 角色ID
  34. }
  35. type ChangeUserInfo struct {
  36. ID uint `gorm:"primarykey"` // 主键ID
  37. NickName string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"` // 用户昵称
  38. Phone string `json:"phone" gorm:"comment:用户手机号"` // 用户角色ID
  39. AuthorityIds []uint `json:"authorityIds" gorm:"-"` // 角色ID
  40. Email string `json:"email" gorm:"comment:用户邮箱"` // 用户邮箱
  41. HeaderImg string `json:"headerImg" gorm:"default:https://qmplusimg.henrongyi.top/gva_header.jpg;comment:用户头像"` // 用户头像
  42. SideMode string `json:"sideMode" gorm:"comment:用户侧边主题"` // 用户侧边主题
  43. Enable int `json:"enable" gorm:"comment:冻结用户"` //冻结用户
  44. Authorities []model.SysAuthority `json:"-" gorm:"many2many:sys_user_authority;"`
  45. }