swagger.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. basePath: /
  2. definitions:
  3. github_com_go-nunu_nunu-layout-advanced_internal_pkg_request.LoginRequest:
  4. properties:
  5. password:
  6. example: "123456"
  7. type: string
  8. username:
  9. example: alan
  10. type: string
  11. required:
  12. - password
  13. - username
  14. type: object
  15. github_com_go-nunu_nunu-layout-advanced_internal_pkg_request.RegisterRequest:
  16. properties:
  17. email:
  18. example: 1234@gmail.com
  19. type: string
  20. password:
  21. example: "123456"
  22. type: string
  23. username:
  24. example: alan
  25. type: string
  26. required:
  27. - email
  28. - password
  29. - username
  30. type: object
  31. github_com_go-nunu_nunu-layout-advanced_internal_pkg_response.Response:
  32. properties:
  33. code:
  34. type: integer
  35. data: {}
  36. message:
  37. type: string
  38. type: object
  39. host: localhost:8000
  40. info:
  41. contact:
  42. email: support@swagger.io
  43. name: API Support
  44. url: http://www.swagger.io/support
  45. description: This is a sample server celler server.
  46. license:
  47. name: Apache 2.0
  48. url: http://www.apache.org/licenses/LICENSE-2.0.html
  49. termsOfService: http://swagger.io/terms/
  50. title: Nunu Example API
  51. version: 1.0.0
  52. paths:
  53. /login:
  54. post:
  55. consumes:
  56. - application/json
  57. parameters:
  58. - description: params
  59. in: body
  60. name: request
  61. required: true
  62. schema:
  63. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_request.LoginRequest'
  64. produces:
  65. - application/json
  66. responses:
  67. "200":
  68. description: OK
  69. schema:
  70. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_response.Response'
  71. summary: 账号登录
  72. tags:
  73. - 用户模块
  74. /register:
  75. post:
  76. consumes:
  77. - application/json
  78. description: 目前只支持邮箱登录
  79. parameters:
  80. - description: params
  81. in: body
  82. name: request
  83. required: true
  84. schema:
  85. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_request.RegisterRequest'
  86. produces:
  87. - application/json
  88. responses:
  89. "200":
  90. description: OK
  91. schema:
  92. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_response.Response'
  93. summary: 用户注册
  94. tags:
  95. - 用户模块
  96. /user:
  97. get:
  98. consumes:
  99. - application/json
  100. produces:
  101. - application/json
  102. responses:
  103. "200":
  104. description: OK
  105. schema:
  106. $ref: '#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_response.Response'
  107. security:
  108. - Bearer: []
  109. summary: 获取用户信息
  110. tags:
  111. - 用户模块
  112. securityDefinitions:
  113. Bearer:
  114. in: header
  115. name: Authorization
  116. type: apiKey
  117. swagger: "2.0"