docs.go 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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_api_v1.LoginRequest"
  45. }
  46. }
  47. ],
  48. "responses": {
  49. "200": {
  50. "description": "OK",
  51. "schema": {
  52. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse"
  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_api_v1.RegisterRequest"
  79. }
  80. }
  81. ],
  82. "responses": {
  83. "200": {
  84. "description": "OK",
  85. "schema": {
  86. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.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_api_v1.GetProfileResponse"
  114. }
  115. }
  116. }
  117. }
  118. }
  119. },
  120. "definitions": {
  121. "github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponse": {
  122. "type": "object",
  123. "properties": {
  124. "code": {
  125. "type": "integer"
  126. },
  127. "data": {
  128. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponseData"
  129. },
  130. "message": {
  131. "type": "string"
  132. }
  133. }
  134. },
  135. "github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponseData": {
  136. "type": "object",
  137. "properties": {
  138. "nickname": {
  139. "type": "string",
  140. "example": "alan"
  141. },
  142. "userId": {
  143. "type": "string"
  144. }
  145. }
  146. },
  147. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginRequest": {
  148. "type": "object",
  149. "required": [
  150. "email",
  151. "password"
  152. ],
  153. "properties": {
  154. "email": {
  155. "type": "string",
  156. "example": "1234@gmail.com"
  157. },
  158. "password": {
  159. "type": "string",
  160. "example": "123456"
  161. }
  162. }
  163. },
  164. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse": {
  165. "type": "object",
  166. "properties": {
  167. "code": {
  168. "type": "integer"
  169. },
  170. "data": {
  171. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData"
  172. },
  173. "message": {
  174. "type": "string"
  175. }
  176. }
  177. },
  178. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData": {
  179. "type": "object",
  180. "properties": {
  181. "accessToken": {
  182. "type": "string"
  183. }
  184. }
  185. },
  186. "github_com_go-nunu_nunu-layout-advanced_api_v1.RegisterRequest": {
  187. "type": "object",
  188. "required": [
  189. "email",
  190. "password"
  191. ],
  192. "properties": {
  193. "email": {
  194. "type": "string",
  195. "example": "1234@gmail.com"
  196. },
  197. "password": {
  198. "type": "string",
  199. "example": "123456"
  200. }
  201. }
  202. },
  203. "github_com_go-nunu_nunu-layout-advanced_api_v1.Response": {
  204. "type": "object",
  205. "properties": {
  206. "code": {
  207. "type": "integer"
  208. },
  209. "data": {},
  210. "message": {
  211. "type": "string"
  212. }
  213. }
  214. }
  215. },
  216. "securityDefinitions": {
  217. "Bearer": {
  218. "type": "apiKey",
  219. "name": "Authorization",
  220. "in": "header"
  221. }
  222. }
  223. }`
  224. // SwaggerInfo holds exported Swagger Info so clients can modify it
  225. var SwaggerInfo = &swag.Spec{
  226. Version: "1.0.0",
  227. Host: "localhost:8000",
  228. BasePath: "",
  229. Schemes: []string{},
  230. Title: "Nunu Example API",
  231. Description: "This is a sample server celler server.",
  232. InfoInstanceName: "swagger",
  233. SwaggerTemplate: docTemplate,
  234. LeftDelim: "{{",
  235. RightDelim: "}}",
  236. }
  237. func init() {
  238. swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
  239. }