swagger.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. basePath: /api
  2. definitions:
  3. e.R:
  4. properties:
  5. code:
  6. $ref: '#/definitions/e.Rescode'
  7. data: {}
  8. message: {}
  9. type: object
  10. e.Rescode:
  11. enum:
  12. - 200
  13. - 201
  14. - 1001
  15. - 1002
  16. - 1003
  17. - 1004
  18. - 1005
  19. - 1006
  20. - 1007
  21. - 1008
  22. - 1009
  23. - 1010
  24. - 1011
  25. - 1012
  26. - 1013
  27. - 1014
  28. - 1015
  29. - 1016
  30. - 1017
  31. type: integer
  32. x-enum-varnames:
  33. - SUCCESS
  34. - ERROR
  35. - TokenIsInvalid
  36. - TokenIsExpired
  37. - DELETEFAIL
  38. - UPDATEFAIL
  39. - PaginationFailed
  40. - JSONParsingFailed
  41. - TheUserAlreadyExists
  42. - AlreadyExists
  43. - TheSystemIsAbnormal
  44. - CodeIsError
  45. - Theuseralreadyexists
  46. - ThePhoneNumberIsWrong
  47. - AnExceptionOccursWhenSendingAnSMSVerificationCode
  48. - TokenIsFaild
  49. - ThePasswordIsWrongOrThePhoneNumberIsIncorrect
  50. - HasSend
  51. - TheUserIsEmpty
  52. models.UserRegist:
  53. properties:
  54. account:
  55. description: 账号
  56. maxLength: 20
  57. minLength: 6
  58. type: string
  59. code:
  60. description: 验证码
  61. maxLength: 6
  62. minLength: 6
  63. type: string
  64. password:
  65. description: 密码
  66. maxLength: 20
  67. minLength: 6
  68. type: string
  69. phone:
  70. description: 手机号
  71. maxLength: 11
  72. minLength: 11
  73. type: string
  74. username:
  75. description: 用户名
  76. maxLength: 20
  77. minLength: 2
  78. type: string
  79. required:
  80. - account
  81. - code
  82. - password
  83. - phone
  84. - username
  85. type: object
  86. page.PageParams:
  87. properties:
  88. desc:
  89. type: string
  90. page:
  91. type: integer
  92. size:
  93. type: integer
  94. type: object
  95. host: 127.0.0.1:8080
  96. info:
  97. contact: {}
  98. description: 统一登录平台
  99. title: 统一登录平台
  100. version: "1.0"
  101. paths:
  102. /admin/getalluser:
  103. post:
  104. consumes:
  105. - application/json
  106. parameters:
  107. - description: 分页信息
  108. in: body
  109. name: req
  110. required: true
  111. schema:
  112. $ref: '#/definitions/page.PageParams'
  113. responses:
  114. "200":
  115. description: OK
  116. schema:
  117. $ref: '#/definitions/e.R'
  118. summary: 获取所有用户
  119. tags:
  120. - 用户管理
  121. /admin/user:
  122. delete:
  123. consumes:
  124. - application/json
  125. parameters:
  126. - description: id
  127. in: query
  128. name: id
  129. required: true
  130. type: string
  131. responses:
  132. "200":
  133. description: OK
  134. schema:
  135. $ref: '#/definitions/e.R'
  136. summary: 删除用户
  137. tags:
  138. - 用户管理
  139. post:
  140. consumes:
  141. - application/json
  142. parameters:
  143. - description: 分页信息
  144. in: body
  145. name: req
  146. required: true
  147. schema:
  148. $ref: '#/definitions/page.PageParams'
  149. responses:
  150. "200":
  151. description: OK
  152. schema:
  153. $ref: '#/definitions/e.R'
  154. summary: 获取所有用户
  155. tags:
  156. - 用户管理
  157. /codelogin:
  158. post:
  159. consumes:
  160. - application/json
  161. parameters:
  162. - description: 账号信息
  163. in: body
  164. name: req
  165. required: true
  166. schema:
  167. $ref: '#/definitions/models.UserRegist'
  168. responses:
  169. "200":
  170. description: OK
  171. schema:
  172. $ref: '#/definitions/e.R'
  173. summary: 验证码登录
  174. tags:
  175. - 用户管理
  176. /sendcode:
  177. post:
  178. consumes:
  179. - application/json
  180. parameters:
  181. - description: 手机号
  182. in: query
  183. name: phone
  184. required: true
  185. type: string
  186. responses:
  187. "200":
  188. description: OK
  189. schema:
  190. $ref: '#/definitions/e.R'
  191. summary: 发送验证码
  192. tags:
  193. - 用户管理
  194. /user:
  195. post:
  196. consumes:
  197. - application/json
  198. parameters:
  199. - description: 账号信息
  200. in: body
  201. name: req
  202. required: true
  203. schema:
  204. $ref: '#/definitions/models.UserRegist'
  205. responses:
  206. "200":
  207. description: OK
  208. schema:
  209. $ref: '#/definitions/e.R'
  210. summary: 账号密码登录
  211. tags:
  212. - 用户管理
  213. swagger: "2.0"