user.go 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package v1
  4. import (
  5. "property-system-gateway/param/base"
  6. "property-system-gateway/pb/v1"
  7. )
  8. type LoginBody struct {
  9. User string `form:"user"`
  10. Password string `form:"password"`
  11. }
  12. type LoginRequest struct {
  13. base.Header
  14. LoginBody
  15. }
  16. type LoginData struct {
  17. Uid int64 `json:"uid"`
  18. Token string `json:"token"`
  19. User string `json:"user"`
  20. IsSuper bool `json:"is_super"`
  21. Company bool `json:"company"`
  22. OpenimId string `json:"openim_id"`
  23. GardenName string `json:"garden_name"`
  24. Permissions []v1.SystemGroupPermissionData `json:"permissions"`
  25. }
  26. type LoginResponse struct {
  27. base.Result
  28. Data LoginData `json:"data"`
  29. // 当账号存在多个小区时使用phone_data
  30. PhoneData LoginByPhoneData `json:"phone_data"`
  31. }
  32. type PermissionRegetRequest struct {
  33. base.Header
  34. }
  35. type PermissionRegetResponse struct {
  36. base.Result
  37. Data LoginData `json:"data"`
  38. }
  39. type TokenRequest struct {
  40. base.Header
  41. }
  42. type TokenResponse struct {
  43. base.Result
  44. Data string `json:"data"`
  45. RefreshToken string `json:"refresh_token"`
  46. }
  47. type GetVcodeQuery struct {
  48. Phone string `form:"phone"`
  49. }
  50. type GetVcodeRequest struct {
  51. GetVcodeQuery
  52. }
  53. type GetVcodeResponse struct {
  54. base.Result
  55. Data v1.GetVcodeReply `json:"data"`
  56. }
  57. type LoginByPhoneBody struct {
  58. // 短信验证码
  59. Vcode uint32 `form:"vcode"`
  60. Phone string `form:"phone"`
  61. }
  62. type LoginByPhoneRequest struct {
  63. base.Header
  64. LoginByPhoneBody
  65. }
  66. type LoginByPhoneItem struct {
  67. Uid int64 `json:"uid"`
  68. User string `json:"user"`
  69. GardenName string `json:"garden_name"`
  70. GardenId int64 `json:"garden_id"`
  71. IsSuper bool `json:"is_super"`
  72. OpenimId string `json:"openim_id"`
  73. Permissions []v1.SystemGroupPermissionData `json:"permissions"`
  74. }
  75. type LoginByPhoneData struct {
  76. List []LoginByPhoneItem `json:"list"`
  77. Token string `json:"token"`
  78. }
  79. type LoginByPhoneResponse struct {
  80. base.Result
  81. Data LoginByPhoneData `json:"data"`
  82. }
  83. type ChooseUserQuery struct {
  84. Id int64 `form:"id" json:"id"`
  85. }
  86. type ChooseUserRequest struct {
  87. base.Header
  88. ChooseUserQuery
  89. }
  90. type ChooseUserResponse struct {
  91. base.Result
  92. Data LoginData `json:"data"`
  93. }
  94. type ResetPasswordBody struct {
  95. Phone string `form:"phone" json:"phone"`
  96. // 用户id,第一次调用时为空,如果电话对应多个账号,选择账号后第二次调用需填该值
  97. Uid int64 `form:"uid" json:"uid"`
  98. // 短信验证码
  99. Vcode uint32 `form:"vcode" json:"vcode"`
  100. Password string `form:"password" json:"password"`
  101. }
  102. type ResetPasswordRequest struct {
  103. ResetPasswordBody
  104. }
  105. type ResetPasswordResponse struct {
  106. base.Result
  107. Data v1.ResetPasswordReply `json:"data"`
  108. }
  109. type ChangePasswordBody struct {
  110. OldPassword string `form:"old_password" json:"old_password"`
  111. NewPassword string `form:"new_password" json:"new_password"`
  112. }
  113. type ChangePasswordRequest struct {
  114. base.Header
  115. ChangePasswordBody
  116. }
  117. type ChangePasswordResponse struct {
  118. base.Result
  119. }
  120. type CompanyEnterGardenRequest struct {
  121. base.Header
  122. }
  123. type CompanyEnterGardenResponse struct {
  124. base.Result
  125. Data LoginData `json:"data"`
  126. }
  127. type StatisticRequest struct {
  128. base.Header
  129. }
  130. type StatisticResponse struct {
  131. base.Result
  132. Data v1.StatisticReply `json:"data"`
  133. }
  134. type PersonInfoRequest struct {
  135. base.Header
  136. }
  137. type PersonInfoData struct {
  138. User string `json:"user"`
  139. RealName string `json:"real_name"`
  140. Phone string `json:"phone"`
  141. Email string `json:"email"`
  142. Gender int32 `json:"gender"`
  143. Department string `json:"department"`
  144. }
  145. type PersonInfoResponse struct {
  146. base.Result
  147. Data PersonInfoData `json:"data"`
  148. }
  149. type PersonInfoUpdateBody struct {
  150. User string `form:"user"json:"user"`
  151. RealName string `form:"real_name" json:"real_name"`
  152. Phone string `form:"phone" json:"phone"`
  153. Email string `form:"email" json:"email"`
  154. Gender int32 `form:"gender" json:"gender"`
  155. }
  156. type PersonInfoUpdateRequest struct {
  157. base.Header
  158. PersonInfoUpdateBody
  159. }
  160. type PersonInfoUpdateResponse struct {
  161. base.Result
  162. }
  163. type OpenImTokenQuery struct {
  164. OpenimId string `form:"openim_id" json:"openim_id"`
  165. }
  166. type OpenImTokenRequest struct {
  167. base.Header
  168. OpenImTokenQuery
  169. }
  170. type OpenImTokenResponse struct {
  171. base.Result
  172. Data v1.OpenImTokenReply `json:"data"`
  173. }
  174. type OpenImUserInfoQuery struct {
  175. OpenimId string `form:"openim_id" json:"openim_id"`
  176. }
  177. type OpenImUserInfoRequest struct {
  178. base.Header
  179. OpenImUserInfoQuery
  180. }
  181. type OpenImUserData struct {
  182. NickName string `json:"nick_name"`
  183. FaceUrl string `json:"face_url"`
  184. Gender int32 `json:"gender"`
  185. }
  186. type OpenImUserInfoResponse struct {
  187. base.Result
  188. Data v1.OpenImUserData `json:"data"`
  189. }
  190. type OpenImUserSetFaceBody struct {
  191. OpenimId string `form:"openim_id" json:"openim_id"`
  192. FaceUrl string `form:"face_url" json:"face_url"`
  193. }
  194. type OpenImUsersInfoQuery struct {
  195. OpenimIds string `form:"openim_ids" json:"openim_ids"`
  196. }
  197. type OpenImUsersInfoRequest struct {
  198. base.Header
  199. OpenImUsersInfoQuery
  200. }
  201. type OpenImUsersInfoResponse struct {
  202. base.Result
  203. Data v1.OpenImUserInfoReply `json:"data"`
  204. }
  205. type OpenImUserSetFaceRequest struct {
  206. base.Header
  207. OpenImUserSetFaceBody
  208. }
  209. type OpenImUserSetFaceResponse struct {
  210. base.Result
  211. }