personal.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * @desc:xxxx功能描述
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu<yxh669@qq.com>
  5. * @Date: 2022/11/3 10:04
  6. */
  7. package system
  8. import (
  9. "github.com/gogf/gf/v2/frame/g"
  10. commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
  11. "github.com/tiger1103/gfast/v3/internal/app/system/model"
  12. "github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
  13. )
  14. type PersonalInfoReq struct {
  15. g.Meta `path:"/personal/getPersonalInfo" tags:"用户管理" method:"get" summary:"登录用户信息"`
  16. commonApi.Author
  17. }
  18. type PersonalInfoRes struct {
  19. g.Meta `mime:"application/json"`
  20. User *entity.SysUser `json:"user"`
  21. Roles []string `json:"roles"`
  22. DeptName string `json:"deptName"`
  23. }
  24. // SetPersonalReq 添加修改用户公用请求字段
  25. type SetPersonalReq struct {
  26. Nickname string `p:"nickname" v:"required#用户昵称不能为空"`
  27. Mobile string `p:"mobile" v:"required|phone#手机号不能为空|手机号格式错误"`
  28. Remark string `p:"remark"`
  29. Sex int `p:"sex"`
  30. UserEmail string `p:"userEmail" v:"required|email#邮箱不能为空|邮箱格式错误"`
  31. Describe string `p:"describe"` //签名
  32. Avatar string `p:"avatar"` //签名
  33. }
  34. // PersonalEditReq 修改个人
  35. type PersonalEditReq struct {
  36. g.Meta `path:"/personal/edit" tags:"用户管理" method:"put" summary:"修改个人资料"`
  37. *SetPersonalReq
  38. commonApi.Author
  39. }
  40. type PersonalEditRes struct {
  41. commonApi.EmptyRes
  42. UserInfo *model.LoginUserRes `json:"userInfo"`
  43. Token string `json:"token"`
  44. }
  45. type PersonalResetPwdReq struct {
  46. g.Meta `path:"/personal/resetPwd" tags:"用户管理" method:"put" summary:"重置个人密码"`
  47. Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头,只能包含字母、数字和下划线,长度在6~18之间"`
  48. commonApi.Author
  49. }
  50. type PersonalResetPwdRes struct {
  51. }