docs.go 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. // Package docs Code generated by swaggo/swag. DO NOT EDIT
  2. package docs
  3. import "github.com/swaggo/swag"
  4. const docTemplate = `{
  5. "schemes": {{ marshal .Schemes }},
  6. "swagger": "2.0",
  7. "info": {
  8. "description": "{{escape .Description}}",
  9. "title": "{{.Title}}",
  10. "termsOfService": "http://swagger.io/terms/",
  11. "contact": {
  12. "name": "API Support",
  13. "url": "http://www.swagger.io/support",
  14. "email": "support@swagger.io"
  15. },
  16. "license": {
  17. "name": "Apache 2.0",
  18. "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
  19. },
  20. "version": "{{.Version}}"
  21. },
  22. "host": "{{.Host}}",
  23. "basePath": "{{.BasePath}}",
  24. "paths": {
  25. "/login": {
  26. "post": {
  27. "consumes": [
  28. "application/json"
  29. ],
  30. "produces": [
  31. "application/json"
  32. ],
  33. "tags": [
  34. "用户模块"
  35. ],
  36. "summary": "账号登录",
  37. "parameters": [
  38. {
  39. "description": "params",
  40. "name": "request",
  41. "in": "body",
  42. "required": true,
  43. "schema": {
  44. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_request.LoginRequest"
  45. }
  46. }
  47. ],
  48. "responses": {
  49. "200": {
  50. "description": "OK",
  51. "schema": {
  52. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_response.Response"
  53. }
  54. }
  55. }
  56. }
  57. },
  58. "/register": {
  59. "post": {
  60. "description": "目前只支持邮箱登录",
  61. "consumes": [
  62. "application/json"
  63. ],
  64. "produces": [
  65. "application/json"
  66. ],
  67. "tags": [
  68. "用户模块"
  69. ],
  70. "summary": "用户注册",
  71. "parameters": [
  72. {
  73. "description": "params",
  74. "name": "request",
  75. "in": "body",
  76. "required": true,
  77. "schema": {
  78. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_request.RegisterRequest"
  79. }
  80. }
  81. ],
  82. "responses": {
  83. "200": {
  84. "description": "OK",
  85. "schema": {
  86. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_response.Response"
  87. }
  88. }
  89. }
  90. }
  91. },
  92. "/user": {
  93. "get": {
  94. "security": [
  95. {
  96. "Bearer": []
  97. }
  98. ],
  99. "consumes": [
  100. "application/json"
  101. ],
  102. "produces": [
  103. "application/json"
  104. ],
  105. "tags": [
  106. "用户模块"
  107. ],
  108. "summary": "获取用户信息",
  109. "responses": {
  110. "200": {
  111. "description": "OK",
  112. "schema": {
  113. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_internal_pkg_response.Response"
  114. }
  115. }
  116. }
  117. }
  118. }
  119. },
  120. "definitions": {
  121. "github_com_go-nunu_nunu-layout-advanced_internal_pkg_request.LoginRequest": {
  122. "type": "object",
  123. "required": [
  124. "password",
  125. "username"
  126. ],
  127. "properties": {
  128. "password": {
  129. "type": "string",
  130. "example": "123456"
  131. },
  132. "username": {
  133. "type": "string",
  134. "example": "alan"
  135. }
  136. }
  137. },
  138. "github_com_go-nunu_nunu-layout-advanced_internal_pkg_request.RegisterRequest": {
  139. "type": "object",
  140. "required": [
  141. "email",
  142. "password",
  143. "username"
  144. ],
  145. "properties": {
  146. "email": {
  147. "type": "string",
  148. "example": "1234@gmail.com"
  149. },
  150. "password": {
  151. "type": "string",
  152. "example": "123456"
  153. },
  154. "username": {
  155. "type": "string",
  156. "example": "alan"
  157. }
  158. }
  159. },
  160. "github_com_go-nunu_nunu-layout-advanced_internal_pkg_response.Response": {
  161. "type": "object",
  162. "properties": {
  163. "code": {
  164. "type": "integer"
  165. },
  166. "data": {},
  167. "message": {
  168. "type": "string"
  169. }
  170. }
  171. }
  172. },
  173. "securityDefinitions": {
  174. "Bearer": {
  175. "type": "apiKey",
  176. "name": "Authorization",
  177. "in": "header"
  178. }
  179. }
  180. }`
  181. // SwaggerInfo holds exported Swagger Info so clients can modify it
  182. var SwaggerInfo = &swag.Spec{
  183. Version: "1.0.0",
  184. Host: "localhost:8000",
  185. BasePath: "/",
  186. Schemes: []string{},
  187. Title: "Nunu Example API",
  188. Description: "This is a sample server celler server.",
  189. InfoInstanceName: "swagger",
  190. SwaggerTemplate: docTemplate,
  191. LeftDelim: "{{",
  192. RightDelim: "}}",
  193. }
  194. func init() {
  195. swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
  196. }