sys_user.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. Fill this file as you wish.
  3. // ==========================================================================
  4. package model
  5. import (
  6. comModel "dashoo.cn/micro/app/common/model"
  7. "dashoo.cn/micro/app/model/internal"
  8. )
  9. // SysUser is the golang structure for table sys_user.
  10. type SysUser internal.SysUser
  11. // Fill with you ideas below.
  12. // LoginParamsReq 登陆参数
  13. type LoginParamsReq struct {
  14. Username string `p:"username" v:"required#用户名不能为空"`
  15. Password string `p:"password" v:"required#密码不能为空"`
  16. VerifyCode string `p:"verifyCode" v:"required#验证码不能为空"`
  17. VerifyKey string `p:"verifyKey"`
  18. }
  19. // LoginUserRes 登录返回
  20. type LoginUserRes struct {
  21. Id uint64 `orm:"id,primary" json:"id"` //
  22. UserName string `orm:"user_name,unique" json:"userName"` // 用户名
  23. UserNickname string `orm:"user_nickname" json:"userNickname"` // 用户昵称
  24. UserPassword string `orm:"user_password" json:"userPassword"` // 登录密码;cmf_password加密
  25. UserSalt string `orm:"user_salt" json:"userSalt"` // 加密盐
  26. UserStatus uint `orm:"user_status" json:"userStatus"` // 用户状态;0:禁用,1:正常,2:未验证
  27. IsAdmin int `orm:"is_admin" json:"isAdmin"` // 是否后台管理员 1 是 0 否
  28. Avatar string `orm:"avatar" json:"avatar"` //头像
  29. DeptId uint64 `orm:"dept_id" json:"deptId"` //部门id
  30. }
  31. // SysUserSearchReq 用户搜索请求参数
  32. type SysUserSearchReq struct {
  33. DeptId string `p:"deptId"` //部门id
  34. DeptIds []int64 //所属部门id数据
  35. Phonenumber string `p:"phonenumber"`
  36. Status string `p:"status"`
  37. KeyWords string `p:"userName"`
  38. comModel.PageReq
  39. }
  40. // SetUserReq 添加修改用户公用请求字段
  41. type SetUserReq struct {
  42. DeptId uint64 `p:"deptId" v:"required#用户部门不能为空"` //所属部门
  43. Email string `p:"email" v:"email#邮箱格式错误"` //邮箱
  44. NickName string `p:"nickName" v:"required#用户昵称不能为空"`
  45. Phonenumber string `p:"phonenumber" v:"required|phone#手机号不能为空|手机号格式错误"`
  46. PostIds []int64 `p:"postIds"`
  47. Remark string `p:"remark"`
  48. RoleIds []int64 `p:"roleIds"`
  49. Sex int `p:"sex"`
  50. Status uint `p:"status"`
  51. IsAdmin int `p:"isAdmin"` // 是否后台管理员 1 是 0 否
  52. }
  53. // AddUserReq 添加用户参数
  54. type AddUserReq struct {
  55. SetUserReq
  56. UserName string `p:"userName" v:"required#用户账号不能为空"`
  57. Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头,只能包含字母、数字和下划线,长度在6~18之间"`
  58. UserSalt string
  59. }
  60. type EditUserReq struct {
  61. SetUserReq
  62. UserId int `p:"userId" v:"required#用户id不能为空"`
  63. }
  64. type SysUserRoleDeptRes struct {
  65. *SysUser
  66. Dept *SysDept `json:"dept"`
  67. RoleInfo []*struct {
  68. RoleId uint `json:"roleId"`
  69. Name string `json:"name"`
  70. } `json:"roleInfo"`
  71. Post []*struct {
  72. PostId int64 `json:"postId"`
  73. PostName string `json:"postName"`
  74. } `json:"post"`
  75. }
  76. // SysUserResetPwdReq 重置用户密码状态参数
  77. type SysUserResetPwdReq struct {
  78. Id uint64 `p:"userId" v:"required#用户id不能为空"`
  79. Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头,只能包含字母、数字和下划线,长度在6~18之间"`
  80. }
  81. // SysUserStatusReq 设置用户状态参数
  82. type SysUserStatusReq struct {
  83. Id uint64 `p:"userId" v:"required#用户id不能为空"`
  84. UserStatus uint `p:"status" v:"required#用户状态不能为空"`
  85. }
  86. // ProfileUpReq 个人中心修改用户信息参数
  87. type ProfileUpReq struct {
  88. UserId uint64
  89. UserNickname string `p:"userNickname" v:"required#用户昵称不能为空" orm:"user_nickname"` // 用户昵称
  90. Mobile string `p:"mobile" v:"required|phone#手机号不能为空|手机号格式错误" orm:"mobile,unique"`
  91. UserEmail string `p:"userEmail" v:"email#邮箱格式错误" orm:"user_email"`
  92. Sex int `p:"sex" orm:"sex"`
  93. }
  94. // ProfileUpdatePwdReq 个人中心修改用户密码
  95. type ProfileUpdatePwdReq struct {
  96. UserId uint64
  97. OldPassword string `p:"oldPassword" v:"required#旧密码不能为空"`
  98. NewPassword string `p:"newPassword" v:"required#新密码不能为空"`
  99. }
  100. // SysUserRes 用于查询用户信息对象
  101. type SysUserRes struct {
  102. Id uint64 `json:"id" orm:"id"`
  103. UserNickname string `json:"userNickname" orm:"user_nickname"`
  104. }