user.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. "smart-site-management-gateway/param/base"
  6. "smart-site-management-gateway/pb/v1"
  7. )
  8. type LoginBody struct {
  9. User string `form:"user"`
  10. Password string `form:"password"`
  11. Verify string `form:"verify"`
  12. Captcha string `form:"captcha"`
  13. RemberPassword bool `form:"rember_password"`
  14. }
  15. type LoginRequest struct {
  16. base.Header
  17. LoginBody
  18. }
  19. type LoginData struct {
  20. Uid int64 `json:"uid"`
  21. Token string `json:"token"`
  22. RefreshToken string `json:"refresh_token"`
  23. IsAdmin bool `json:"is_admin"`
  24. User string `json:"user"`
  25. }
  26. type LoginResponse struct {
  27. base.Result
  28. Data LoginData `json:"data"`
  29. }
  30. type TokenRequest struct {
  31. base.Header
  32. }
  33. type TokenResponse struct {
  34. base.Result
  35. Data string `json:"data"`
  36. RefreshToken string `json:"refresh_token"`
  37. }
  38. type VcodeQuery struct {
  39. Phone string `form:"phone"`
  40. }
  41. type VcodeRequest struct {
  42. VcodeQuery
  43. }
  44. type VcodeResponse struct {
  45. base.Result
  46. Data v1.GetVcodeReply `json:"data"`
  47. }
  48. type FindPasswdVerifyBody struct {
  49. Phone string `form:"phone"`
  50. Verify string `form:"verify"`
  51. Vcode uint32 `form:"vcode"`
  52. Captcha string `form:"captcha"`
  53. }
  54. type FindPasswdVerifyRequest struct {
  55. FindPasswdVerifyBody
  56. }
  57. type FindPasswdVerifyResponse struct {
  58. base.Result
  59. }
  60. type ChangePasswdBody struct {
  61. Old string `form:"old"`
  62. New string `form:"new"`
  63. }
  64. type ChangePasswdRequest struct {
  65. base.Header
  66. ChangePasswdBody
  67. }
  68. type ChangePasswdResponse struct {
  69. base.Result
  70. }
  71. type MailUpdateQuery struct {
  72. Token string `form:"token"`
  73. }
  74. type MailUpdateRequest struct {
  75. MailUpdateQuery
  76. }
  77. type MailUpdateResponse struct {
  78. base.Result
  79. }
  80. type MailPrepareBody struct {
  81. Email string `form:"email"`
  82. Password string `form:"password"`
  83. }
  84. type MailPrepareRequest struct {
  85. base.Header
  86. MailPrepareBody
  87. }
  88. type MailPrepareResponse struct {
  89. base.Result
  90. }
  91. type PhoneUpdateBody struct {
  92. Phone string `form:"phone"`
  93. Vcode uint32 `form:"vcode"`
  94. }
  95. type PhoneUpdateRequest struct {
  96. base.Header
  97. PhoneUpdateBody
  98. }
  99. type PhoneUpdateResponse struct {
  100. base.Result
  101. }
  102. type UserInfoRequest struct {
  103. base.Header
  104. }
  105. type UserInfoResponse struct {
  106. base.Result
  107. Data v1.UserInfoReply `json:"data"`
  108. }
  109. type LogListQuery struct {
  110. Page int32 `form:"page"`
  111. Start int64 `form:"start"`
  112. End int64 `form:"end"`
  113. }
  114. type LogListRequest struct {
  115. base.Header
  116. LogListQuery
  117. }
  118. type LogListResponse struct {
  119. base.Result
  120. Data v1.LogListReply `json:"data"`
  121. }
  122. type CaptchaIdRequest struct {
  123. }
  124. type CaptchaIdResponse struct {
  125. base.Result
  126. CaptureId string
  127. }
  128. type CaptchaPngPath struct {
  129. CaptchaId string `uri:"captcha_id"`
  130. }
  131. type CaptchaPngRequest struct {
  132. CaptchaPngPath
  133. }
  134. type CaptchaPngResponse struct {
  135. }
  136. type UserPermissionRequest struct{
  137. base.Header
  138. }
  139. type UserPermissionData struct {
  140. IsAdmin bool `json:"is_admin"`
  141. UserName string `json:"user_name"`
  142. }
  143. type UserPermissionResponse struct {
  144. base.Result
  145. Data UserPermissionData `json:"data"`
  146. }