user.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package request
  2. import "dy-admin/internal/pcmserver/common"
  3. type Login struct {
  4. Username string `json:"username"` // 用户名
  5. Password string `json:"password"` // 密码
  6. }
  7. type Register struct {
  8. Username string `json:"userName" example:"用户名"`
  9. Password string `json:"passWord" example:"密码"`
  10. NickName string `json:"nickName" example:"昵称"`
  11. Phone string `json:"phone" example:"电话号码"`
  12. Sex string `json:"sex" `
  13. Email string `json:"email"`
  14. DeptId int `json:"deptId" `
  15. Remark string `json:"remark"`
  16. Status string `json:"status"`
  17. RoleIds []int `json:"roleIds"`
  18. }
  19. type SearchUserReq struct {
  20. NickName string `json:"nickName" form:"nickName"`
  21. Status string `json:"status" form:"status"`
  22. Phone string `json:"phone" form:"phone"`
  23. DeptId int `json:"deptId" form:"deptId"`
  24. common.PageInfo
  25. }
  26. type ChangePasswordReq struct {
  27. UserID uint `json:"-"` // 从 JWT 中提取 user id,避免越权
  28. Password string `json:"password"` // 密码
  29. NewPassword string `json:"newPassword"` // 新密码
  30. }
  31. type ChangeUserInfoReq struct {
  32. UserId int `json:"userId" `
  33. Username string `json:"userName" `
  34. NickName string `json:"nickName" `
  35. Phone string `json:"phone" `
  36. Sex string `json:"sex" `
  37. Email string `json:"email"`
  38. DeptId int `json:"deptId" `
  39. Remark string `json:"remark"`
  40. Status string `json:"status"`
  41. RoleIds []int `json:"roleIds"`
  42. }
  43. type ChangeSelfInfoReq struct {
  44. Username string `json:"userName" example:"用户名"`
  45. NickName string `json:"nickName" example:"昵称"`
  46. Phone string `json:"phone" example:"电话号码"`
  47. Sex string `json:"sex" `
  48. Email string `json:"email"`
  49. DeptId int `json:"deptId" `
  50. Remark string `json:"remark"`
  51. Status string `json:"status"`
  52. }