user.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package services
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "hongze/hongze_yb_en_api/models/english_report_email"
  5. )
  6. type LoginReq struct {
  7. Account string `description:"账号"`
  8. CountryCode string `description:"区号"`
  9. Type int `description:"类型 1:邮箱 2:手机"`
  10. Password string `description:"密码"`
  11. }
  12. type LoginResp struct {
  13. Authorization string
  14. AdminName string `description:"系统用户名称"`
  15. RealName string `description:"系统用户姓名"`
  16. RoleName string `description:"角色名称"`
  17. RoleTypeCode string `description:"角色类型编码"`
  18. SysRoleTypeCode string `description:"角色类型编码"`
  19. AdminId int `description:"系统用户id"`
  20. ProductName string `description:"产品名称:admin,ficc,权益"`
  21. Authority int `description:"管理权限,0:无,1:部门负责人,2:小组负责人,或者ficc销售主管,4:ficc销售组长"`
  22. }
  23. type RegisterReq struct {
  24. Password string
  25. Name string //客户名称
  26. CompanyName string //公司名称
  27. Email string //邮箱地址
  28. SmsCode string //验证码
  29. }
  30. type ModifyPwdReq struct {
  31. OldPwd string `description:"旧密码"`
  32. NewPwd string `description:"新密码"`
  33. }
  34. type UserInfo struct {
  35. english_report_email.Email
  36. LoginToken string
  37. }
  38. // GetInfoByClaims 从Claims中获取用户信息
  39. func GetInfoByClaims(c *gin.Context) (userInfo UserInfo) {
  40. //获取jwt数据失败
  41. claims, _ := c.Get("userInfo")
  42. userInfo = claims.(UserInfo)
  43. return
  44. }
  45. type BindMobileReq struct {
  46. CountryCode string `description:"区号"`
  47. Mobile string
  48. SmsCode string //验证码
  49. }
  50. type ForgetPwdReq struct {
  51. Type int `description:"类型 1:邮箱 2:手机"`
  52. CountryCode string `description:"区号"`
  53. Account string `description:"账号"`
  54. Password string `description:"密码"`
  55. SmsCode string
  56. }
  57. type ModifyMobile struct {
  58. CountryCode string `description:"区号"`
  59. OldMobile string
  60. NewMobile string
  61. SmsCode string
  62. }