user.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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-company-gateway/param/base"
  6. pb_v1 "property-company-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. }
  21. type LoginResponse struct {
  22. base.Result
  23. Data LoginData `json:"data"`
  24. }
  25. type TokenRequest struct {
  26. base.Header
  27. }
  28. type TokenResponse struct {
  29. base.Result
  30. Data string `json:"data"`
  31. RefreshToken string `json:"refresh_token"`
  32. }
  33. type ResetePasswdResponse struct {
  34. base.Result
  35. }
  36. type GetVcodeQuery struct {
  37. Phone string `form:"phone"`
  38. }
  39. type GetVcodeRequest struct {
  40. GetVcodeQuery
  41. }
  42. type GetVcodeResponse struct {
  43. base.Result
  44. Data pb_v1.GetVcodeReply `json:"data"`
  45. }
  46. type LoginByPhoneBody struct {
  47. // 短信验证码
  48. Vcode uint32 `form:"vcode"`
  49. Phone string `form:"phone"`
  50. }
  51. type LoginByPhoneRequest struct {
  52. base.Header
  53. LoginByPhoneBody
  54. }
  55. type LoginByPhoneResponse struct {
  56. base.Result
  57. Data LoginData `json:"data"`
  58. }
  59. type ResetPasswordBody struct {
  60. Phone string `form:"phone" json:"phone"`
  61. // 短信验证码
  62. Vcode uint32 `form:"vcode" json:"vcode"`
  63. Password string `form:"password" json:"password"`
  64. }
  65. type ResetPasswordRequest struct {
  66. ResetPasswordBody
  67. }
  68. type ResetPasswordResponse struct {
  69. base.Result
  70. }
  71. type ChangePasswordBody struct {
  72. OldPassword string `form:"old_password" json:"old_password"`
  73. NewPassword string `form:"new_password" json:"new_password"`
  74. }
  75. type ChangePasswordRequest struct {
  76. base.Header
  77. ChangePasswordBody
  78. }
  79. type ChangePasswordResponse struct {
  80. base.Result
  81. }
  82. type CompanyUserAddBody struct {
  83. UserName string `form:"user_name" json:"user_name"`
  84. Password string `form:"password" json:"password"`
  85. Email string `form:"email" json:"email"`
  86. Phone string `form:"phone" json:"phone"`
  87. RealName string `form:"real_name" json:"real_name"`
  88. }
  89. type CompanyUserAddRequest struct {
  90. base.Header
  91. CompanyUserAddBody
  92. }
  93. type CompanyUserAddResponse struct {
  94. base.Result
  95. Data pb_v1.CompanyUserAddReply `json:"data"`
  96. }
  97. type CompanyUserUpdateBody struct {
  98. UserName string `form:"user_name" json:"user_name"`
  99. Password string `form:"password" json:"password"`
  100. Email string `form:"email" json:"email"`
  101. Phone string `form:"phone" json:"phone"`
  102. Id int64 `form:"id"`
  103. RealName string `form:"real_name" json:"real_name"`
  104. }
  105. type CompanyUserUpdateRequest struct {
  106. base.Header
  107. CompanyUserUpdateBody
  108. }
  109. type CompanyUserUpdateResponse struct {
  110. base.Result
  111. }
  112. type CompanyUserDelQuery struct {
  113. Id int64 `form:"id"`
  114. }
  115. type CompanyUserDelRequest struct {
  116. base.Header
  117. CompanyUserDelQuery
  118. }
  119. type CompanyUserDelResponse struct {
  120. base.Result
  121. }
  122. type CompanyUserListQuery struct {
  123. Page int64 `form:"page"`
  124. PageSize int64 `form:"page_size" json:"page_size"`
  125. }
  126. type CompanyUserListRequest struct {
  127. base.Header
  128. CompanyUserListQuery
  129. }
  130. type CompanyUserListResponse struct {
  131. base.Result
  132. Data pb_v1.CompanyUserListReply `json:"data"`
  133. }