docs.go 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. },
  141. "userId": {
  142. "type": "string"
  143. }
  144. }
  145. },
  146. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginRequest": {
  147. "type": "object",
  148. "required": [
  149. "password",
  150. "username"
  151. ],
  152. "properties": {
  153. "password": {
  154. "type": "string",
  155. "example": "123456"
  156. },
  157. "username": {
  158. "type": "string",
  159. "example": "alan"
  160. }
  161. }
  162. },
  163. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse": {
  164. "type": "object",
  165. "properties": {
  166. "code": {
  167. "type": "integer"
  168. },
  169. "data": {
  170. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData"
  171. },
  172. "message": {
  173. "type": "string"
  174. }
  175. }
  176. },
  177. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData": {
  178. "type": "object",
  179. "properties": {
  180. "accessToken": {
  181. "type": "string"
  182. }
  183. }
  184. },
  185. "github_com_go-nunu_nunu-layout-advanced_api_v1.RegisterRequest": {
  186. "type": "object",
  187. "required": [
  188. "email",
  189. "password",
  190. "username"
  191. ],
  192. "properties": {
  193. "email": {
  194. "type": "string",
  195. "example": "1234@gmail.com"
  196. },
  197. "password": {
  198. "type": "string",
  199. "example": "123456"
  200. },
  201. "username": {
  202. "type": "string",
  203. "example": "alan"
  204. }
  205. }
  206. },
  207. "github_com_go-nunu_nunu-layout-advanced_api_v1.Response": {
  208. "type": "object",
  209. "properties": {
  210. "code": {
  211. "type": "integer"
  212. },
  213. "data": {},
  214. "message": {
  215. "type": "string"
  216. }
  217. }
  218. }
  219. },
  220. "securityDefinitions": {
  221. "Bearer": {
  222. "type": "apiKey",
  223. "name": "Authorization",
  224. "in": "header"
  225. }
  226. }
  227. }`
  228. // SwaggerInfo holds exported Swagger Info so clients can modify it
  229. var SwaggerInfo = &swag.Spec{
  230. Version: "1.0.0",
  231. Host: "localhost:8000",
  232. BasePath: "",
  233. Schemes: []string{},
  234. Title: "Nunu Example API",
  235. Description: "This is a sample server celler server.",
  236. InfoInstanceName: "swagger",
  237. SwaggerTemplate: docTemplate,
  238. LeftDelim: "{{",
  239. RightDelim: "}}",
  240. }
  241. func init() {
  242. swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
  243. }