swagger.yaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. definitions:
  2. github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponse:
  3. properties:
  4. code:
  5. type: integer
  6. data:
  7. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponseData'
  8. message:
  9. type: string
  10. type: object
  11. github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponseData:
  12. properties:
  13. nickname:
  14. example: alan
  15. type: string
  16. userId:
  17. type: string
  18. type: object
  19. github_com_go-nunu_nunu-layout-advanced_api_v1.LoginRequest:
  20. properties:
  21. email:
  22. example: 1234@gmail.com
  23. type: string
  24. password:
  25. example: "123456"
  26. type: string
  27. required:
  28. - email
  29. - password
  30. type: object
  31. github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse:
  32. properties:
  33. code:
  34. type: integer
  35. data:
  36. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData'
  37. message:
  38. type: string
  39. type: object
  40. github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData:
  41. properties:
  42. accessToken:
  43. type: string
  44. type: object
  45. github_com_go-nunu_nunu-layout-advanced_api_v1.RegisterRequest:
  46. properties:
  47. email:
  48. example: 1234@gmail.com
  49. type: string
  50. password:
  51. example: "123456"
  52. type: string
  53. required:
  54. - email
  55. - password
  56. type: object
  57. github_com_go-nunu_nunu-layout-advanced_api_v1.Response:
  58. properties:
  59. code:
  60. type: integer
  61. data: {}
  62. message:
  63. type: string
  64. type: object
  65. github_com_go-nunu_nunu-layout-advanced_api_v1.UpdateProfileRequest:
  66. properties:
  67. email:
  68. example: 1234@gmail.com
  69. type: string
  70. nickname:
  71. example: alan
  72. type: string
  73. required:
  74. - email
  75. type: object
  76. host: localhost:8000
  77. info:
  78. contact:
  79. email: support@swagger.io
  80. name: API Support
  81. url: http://www.swagger.io/support
  82. description: This is a sample server celler server.
  83. license:
  84. name: Apache 2.0
  85. url: http://www.apache.org/licenses/LICENSE-2.0.html
  86. termsOfService: http://swagger.io/terms/
  87. title: Nunu Example API
  88. version: 1.0.0
  89. paths:
  90. /login:
  91. post:
  92. consumes:
  93. - application/json
  94. parameters:
  95. - description: params
  96. in: body
  97. name: request
  98. required: true
  99. schema:
  100. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginRequest'
  101. produces:
  102. - application/json
  103. responses:
  104. "200":
  105. description: OK
  106. schema:
  107. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse'
  108. summary: 账号登录
  109. tags:
  110. - 用户模块
  111. /register:
  112. post:
  113. consumes:
  114. - application/json
  115. description: 目前只支持邮箱登录
  116. parameters:
  117. - description: params
  118. in: body
  119. name: request
  120. required: true
  121. schema:
  122. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.RegisterRequest'
  123. produces:
  124. - application/json
  125. responses:
  126. "200":
  127. description: OK
  128. schema:
  129. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.Response'
  130. summary: 用户注册
  131. tags:
  132. - 用户模块
  133. /user:
  134. get:
  135. consumes:
  136. - application/json
  137. produces:
  138. - application/json
  139. responses:
  140. "200":
  141. description: OK
  142. schema:
  143. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponse'
  144. security:
  145. - Bearer: []
  146. summary: 获取用户信息
  147. tags:
  148. - 用户模块
  149. put:
  150. consumes:
  151. - application/json
  152. parameters:
  153. - description: params
  154. in: body
  155. name: request
  156. required: true
  157. schema:
  158. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.UpdateProfileRequest'
  159. produces:
  160. - application/json
  161. responses:
  162. "200":
  163. description: OK
  164. schema:
  165. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.Response'
  166. security:
  167. - Bearer: []
  168. summary: 修改用户信息
  169. tags:
  170. - 用户模块
  171. securityDefinitions:
  172. Bearer:
  173. in: header
  174. name: Authorization
  175. type: apiKey
  176. swagger: "2.0"