swagger.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. host: localhost:8000
  66. info:
  67. contact:
  68. email: support@swagger.io
  69. name: API Support
  70. url: http://www.swagger.io/support
  71. description: This is a sample server celler server.
  72. license:
  73. name: Apache 2.0
  74. url: http://www.apache.org/licenses/LICENSE-2.0.html
  75. termsOfService: http://swagger.io/terms/
  76. title: Nunu Example API
  77. version: 1.0.0
  78. paths:
  79. /login:
  80. post:
  81. consumes:
  82. - application/json
  83. parameters:
  84. - description: params
  85. in: body
  86. name: request
  87. required: true
  88. schema:
  89. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginRequest'
  90. produces:
  91. - application/json
  92. responses:
  93. "200":
  94. description: OK
  95. schema:
  96. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse'
  97. summary: 账号登录
  98. tags:
  99. - 用户模块
  100. /register:
  101. post:
  102. consumes:
  103. - application/json
  104. description: 目前只支持邮箱登录
  105. parameters:
  106. - description: params
  107. in: body
  108. name: request
  109. required: true
  110. schema:
  111. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.RegisterRequest'
  112. produces:
  113. - application/json
  114. responses:
  115. "200":
  116. description: OK
  117. schema:
  118. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.Response'
  119. summary: 用户注册
  120. tags:
  121. - 用户模块
  122. /user:
  123. get:
  124. consumes:
  125. - application/json
  126. produces:
  127. - application/json
  128. responses:
  129. "200":
  130. description: OK
  131. schema:
  132. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponse'
  133. security:
  134. - Bearer: []
  135. summary: 获取用户信息
  136. tags:
  137. - 用户模块
  138. securityDefinitions:
  139. Bearer:
  140. in: header
  141. name: Authorization
  142. type: apiKey
  143. swagger: "2.0"