user.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. package model
  2. // ReqLogin 用户登录参数
  3. type ReqLogin struct {
  4. Username string `form:"username"` // 用户名
  5. Password string `form:"password"` // 密码
  6. }
  7. type ResLogin struct {
  8. User LoginInfo `json:"user"`
  9. Token string `json:"token"`
  10. ExpiresAt int64 `json:"expires_at"`
  11. }
  12. type LoginInfoRes struct {
  13. Id int64 `json:"id"`
  14. Account string `json:"account"` // 账号
  15. Gid int64 `json:"gid"` // 分组ID
  16. HeadPic int64 `json:"head_pic"` // 头像ID
  17. Name string `json:"name"` // 用户昵称
  18. LastLoginTime int64 `json:"last_login_time"` // 最后登录时间
  19. RouterList []RouteInfo `json:"router_list"`
  20. BindFs bool `json:"bind_fs"` // 是否绑定了飞书
  21. FsHeadPic string `json:"fs_head_pic"` // 飞书账号头像
  22. FsName string `json:"fs_name"` // 飞书账号名字
  23. ExpiresAt int64 `json:"expires_at"` // token 过期时间
  24. Token string `json:"token"` // token信息
  25. }
  26. type FsLoginToken struct {
  27. UserInfo string `json:"user_info"`
  28. }
  29. type FsBindToken struct {
  30. BindFs bool `json:"bind_fs"`
  31. FsHeadPic string `json:"fs_head_pic"`
  32. FsName string `json:"fs_name"`
  33. }
  34. type ResUserList struct {
  35. Id int64 `json:"id"`
  36. Account string `json:"account"` // 账号
  37. Gid int64 `json:"gid"` // 分组ID
  38. Name string `json:"name"` // 用户昵称
  39. Mobile string `json:"mobile"` // 手机号码
  40. CreateTime string `json:"create_time"` // 创建时间
  41. CreateBy string `json:"create_by"` // 创建人
  42. BindFs bool `json:"bind_fs"` // 是否绑定飞书
  43. }
  44. type TUsers struct {
  45. Id int64 `json:"id" db:"id" form:"id"`
  46. Account string `json:"account" db:"account" form:"account"` // 账号
  47. Name string `json:"name" db:"name" form:"name"` // 用户昵称
  48. Mobile string `json:"mobile" db:"mobile" form:"mobile"` // 手机号码
  49. CreateTime int64 `json:"create_time" db:"create_time" form:"create_time"` // 创建时间
  50. Password string `json:"password" db:"password" form:"password"` // 密码
  51. HeadPic int64 `json:"head_pic" db:"head_pic" form:"head_pic"` // 头像ID
  52. UpdateTime int64 `json:"update_time" db:"update_time" form:"update_time"` // 更新时间
  53. LastLoginTime int64 `json:"last_login_time" db:"last_login_time" form:"last_login_time"` // 最后登录时间
  54. CreateBy string `json:"create_by" db:"create_by" form:"create_by"` // 创建人
  55. BindFs bool `json:"bind_fs" db:"bind_fs" form:"bind_fs"` // 是否绑定飞书
  56. }
  57. func (TUsers) TableName() string {
  58. return "crazy_cms_user.cms_user"
  59. }
  60. type UserInfo struct {
  61. TUsers
  62. Gid int64 `json:"gid" form:"gid"` //分组ID
  63. }
  64. type LoginInfo struct {
  65. TUsers
  66. RouterList []RouteInfo `json:"router_list" from:"router_list" db:"router_list"`
  67. }
  68. // ChangePasswordStruct Modify password structure
  69. type ChangePasswordStruct struct {
  70. Id int64 `form:"id" json:"id" db:"id"` // 用户ID
  71. Password string `form:"password" json:"password" db:"password"` // 原密码
  72. NewPassword string `form:"newPassword" json:"newPassword" db:"newPassword"` // 新密码
  73. }
  74. // UpdateHeadPicStruct Modify headPic structure
  75. type UpdateHeadPicStruct struct {
  76. Id int64 `form:"id" json:"id" db:"id"` // 用户ID
  77. HeadPic int64 `form:"headPic" json:"headPic" db:"headPic"` // 头像ID
  78. }
  79. type UpdateUserInfo struct {
  80. Id int64 `json:"id" form:"id" db:"id"`
  81. Gid int64 `json:"gid" form:"gid" db:"gid"` // 分组ID
  82. Name string `json:"name" form:"name" db:"name"` // 用户昵称
  83. Mobile string `json:"mobile" form:"mobile" db:"mobile"` // 手机号码
  84. }
  85. type UpdateUserGid struct {
  86. Id int64 `json:"id" form:"id" db:"id"`
  87. Gid int64 `json:"gid" form:"gid" db:"gid"`
  88. }
  89. type MultiUpdateUserGid struct {
  90. UserGidList []UpdateUserGid `json:"userGidList" from:"userGidList" db:"userGidList"` //用户信息列表
  91. }
  92. type CreateUserInfo struct {
  93. Account string `json:"account" form:"account" db:"account"` // 账号
  94. Gid int64 `json:"gid" form:"gid" db:"gid"` // 分组ID
  95. Name string `json:"name" form:"name" db:"name"` // 用户昵称
  96. Mobile string `json:"mobile" form:"mobile" db:"mobile"` // 手机号码
  97. CreateTime int64 `json:"create_time" form:"create_time" db:"create_time"` // 创建时间
  98. CreateBy string `json:"create_by" form:"create_by" db:"create_by"` // 创建人
  99. }
  100. // ReqUserList Paging common input parameter structure
  101. type ReqUserList struct {
  102. PageInfo
  103. Gid int64 `form:"gid"` // 分组id
  104. FilterGidList []int64 `form:"filter_gid_list"` // 筛选分组id列表
  105. }
  106. type RefreshUserInfo struct {
  107. Gid int64 `json:"gid"` //分组ID
  108. RouterList []RouteInfo `json:"router_list"`
  109. }