swagger.yaml 3.6 KB

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