sys_user.go 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. Fill this file as you wish.
  3. // ==========================================================================
  4. package model
  5. import (
  6. "dashoo.cn/micro/app/model/internal"
  7. "dashoo.cn/opms_libary/request"
  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 int `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 string `orm:"user_status" json:"userStatus"` // 用户状态;0:禁用,1:正常,2:未验证
  27. Avatar string `orm:"avatar" json:"avatar"` //头像
  28. DeptId int `orm:"dept_id" json:"deptId"` //部门id
  29. }
  30. // SysUserSearchReq 用户搜索请求参数
  31. type SysUserSearchReq struct {
  32. KeyWords string `json:"keyWords"`
  33. DeptId int `json:"deptId"` //部门id
  34. DeptIds []int //所属部门id数据
  35. Phone string `json:"phone"`
  36. Status string `json:"status"`
  37. Roles []string `json:"roles"`
  38. Posts []string `json:"posts"`
  39. Groups []string `json:"groups"`
  40. request.PageReq
  41. }
  42. type SysUserRes struct {
  43. SysUser
  44. DeptName string `json:"deptName"` //部门名称
  45. PostName string `json:"postName"` //岗位名称
  46. }
  47. // SetUserReq 添加修改用户公用请求字段
  48. type SetUserReq struct {
  49. DeptId int `p:"deptId" v:"required#用户部门不能为空"` //所属部门
  50. NickName string `p:"nickName" v:"required#用户昵称不能为空"`
  51. Email string `p:"email" v:"email#邮箱格式错误"` //邮箱
  52. Phone string `p:"phone" v:"required|phone#手机号不能为空|手机号格式错误"`
  53. Sex string `p:"sex" v:"in:10,20,30#性别只能为10、20、30"`
  54. Status string `p:"status" v:"required|in:10,20#状态不能为空|状态只能为10或20"`
  55. WechatId string `p:"wechatId"` // 微信账号
  56. Remark string `p:"remark"`
  57. IsAdmin int `p:"isAdmin"` // 是否后台管理员 1 是 0 否
  58. RoleIds []int `p:"roleIds"`
  59. PostIds []int `p:"postIds"`
  60. GroupIds []int `p:"groupIds"`
  61. }
  62. // AddUserReq 添加用户参数
  63. type AddUserReq struct {
  64. SetUserReq
  65. UserName string `p:"userName" v:"required#用户账号不能为空"`
  66. Password string `p:"password" v:"required|password3#密码不能为空|密码必须包含大小写字母、数字和特殊字符,长度在6~18之间"`
  67. }
  68. type EditUserReq struct {
  69. SetUserReq
  70. Id int `p:"id" v:"required#用户id不能为空"`
  71. }
  72. type SysUserRoleDeptRes struct {
  73. *SysUser
  74. Dept *SysDept `json:"dept"`
  75. RoleInfo []*struct {
  76. RoleId int `json:"roleId"`
  77. Name string `json:"name"`
  78. } `json:"roleInfo"`
  79. Post []*struct {
  80. PostId int `json:"postId"`
  81. PostName string `json:"postName"`
  82. } `json:"post"`
  83. }
  84. // SysResetPwdReq 系统重置用户密码状态参数
  85. type SysResetPwdReq struct {
  86. Id int `p:"id" v:"required#用户id不能为空"`
  87. Password string `p:"password" v:"required|password3#密码不能为空|密码必须包含大小写字母、数字和特殊字符,长度在6~18之间"`
  88. }
  89. // SysUserResetPwdReq 用户重置密码状态参数
  90. type SysUserResetPwdReq struct {
  91. OldPassword string `json:"oldPassword" v:"required#旧密码不能为空"`
  92. NewPassword string `json:"newPassword" v:"required|password3#新密码不能为空|新密码必须包含大小写字母、数字和特殊字符,长度在6~18之间"`
  93. }
  94. // SysUserStatusReq 设置用户状态参数
  95. type SysUserStatusReq struct {
  96. Id int `p:"userId" v:"required#用户id不能为空"`
  97. UserStatus int `p:"status" v:"required#用户状态不能为空"`
  98. }
  99. // ProfileUpReq 个人中心修改用户信息参数
  100. type ProfileUpReq struct {
  101. UserId int
  102. UserNickname string `p:"userNickname" v:"required#用户昵称不能为空" orm:"user_nickname"` // 用户昵称
  103. Mobile string `p:"mobile" v:"required|phone#手机号不能为空|手机号格式错误" orm:"mobile,unique"`
  104. UserEmail string `p:"userEmail" v:"email#邮箱格式错误" orm:"user_email"`
  105. Sex int `p:"sex" orm:"sex"`
  106. }
  107. // ProfileUpdatePwdReq 个人中心修改用户密码
  108. type ProfileUpdatePwdReq struct {
  109. UserId int
  110. OldPassword string `p:"oldPassword" v:"required#旧密码不能为空"`
  111. NewPassword string `p:"newPassword" v:"required#新密码不能为空"`
  112. }
  113. // SysUserNickNameRes 用于查询用户信息对象
  114. type SysUserNickNameRes struct {
  115. Id int `json:"id" orm:"id"`
  116. UserNickname string `json:"userNickname" orm:"nick_name"`
  117. }
  118. type DeptIdReq struct {
  119. DeptId int `json:"dept_id,omitempty"`
  120. Include bool `json:"include,omitempty"`
  121. }