docs.go 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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. "put": {
  119. "security": [
  120. {
  121. "Bearer": []
  122. }
  123. ],
  124. "consumes": [
  125. "application/json"
  126. ],
  127. "produces": [
  128. "application/json"
  129. ],
  130. "tags": [
  131. "用户模块"
  132. ],
  133. "summary": "修改用户信息",
  134. "parameters": [
  135. {
  136. "description": "params",
  137. "name": "request",
  138. "in": "body",
  139. "required": true,
  140. "schema": {
  141. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.UpdateProfileRequest"
  142. }
  143. }
  144. ],
  145. "responses": {
  146. "200": {
  147. "description": "OK",
  148. "schema": {
  149. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.Response"
  150. }
  151. }
  152. }
  153. }
  154. }
  155. },
  156. "definitions": {
  157. "github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponse": {
  158. "type": "object",
  159. "properties": {
  160. "code": {
  161. "type": "integer"
  162. },
  163. "data": {
  164. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponseData"
  165. },
  166. "message": {
  167. "type": "string"
  168. }
  169. }
  170. },
  171. "github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponseData": {
  172. "type": "object",
  173. "properties": {
  174. "nickname": {
  175. "type": "string",
  176. "example": "alan"
  177. },
  178. "userId": {
  179. "type": "string"
  180. }
  181. }
  182. },
  183. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginRequest": {
  184. "type": "object",
  185. "required": [
  186. "email",
  187. "password"
  188. ],
  189. "properties": {
  190. "email": {
  191. "type": "string",
  192. "example": "1234@gmail.com"
  193. },
  194. "password": {
  195. "type": "string",
  196. "example": "123456"
  197. }
  198. }
  199. },
  200. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse": {
  201. "type": "object",
  202. "properties": {
  203. "code": {
  204. "type": "integer"
  205. },
  206. "data": {
  207. "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData"
  208. },
  209. "message": {
  210. "type": "string"
  211. }
  212. }
  213. },
  214. "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData": {
  215. "type": "object",
  216. "properties": {
  217. "accessToken": {
  218. "type": "string"
  219. }
  220. }
  221. },
  222. "github_com_go-nunu_nunu-layout-advanced_api_v1.RegisterRequest": {
  223. "type": "object",
  224. "required": [
  225. "email",
  226. "password"
  227. ],
  228. "properties": {
  229. "email": {
  230. "type": "string",
  231. "example": "1234@gmail.com"
  232. },
  233. "password": {
  234. "type": "string",
  235. "example": "123456"
  236. }
  237. }
  238. },
  239. "github_com_go-nunu_nunu-layout-advanced_api_v1.Response": {
  240. "type": "object",
  241. "properties": {
  242. "code": {
  243. "type": "integer"
  244. },
  245. "data": {},
  246. "message": {
  247. "type": "string"
  248. }
  249. }
  250. },
  251. "github_com_go-nunu_nunu-layout-advanced_api_v1.UpdateProfileRequest": {
  252. "type": "object",
  253. "required": [
  254. "email"
  255. ],
  256. "properties": {
  257. "email": {
  258. "type": "string",
  259. "example": "1234@gmail.com"
  260. },
  261. "nickname": {
  262. "type": "string",
  263. "example": "alan"
  264. }
  265. }
  266. }
  267. },
  268. "securityDefinitions": {
  269. "Bearer": {
  270. "type": "apiKey",
  271. "name": "Authorization",
  272. "in": "header"
  273. }
  274. }
  275. }`
  276. // SwaggerInfo holds exported Swagger Info so clients can modify it
  277. var SwaggerInfo = &swag.Spec{
  278. Version: "1.0.0",
  279. Host: "localhost:8000",
  280. BasePath: "",
  281. Schemes: []string{},
  282. Title: "Nunu Example API",
  283. Description: "This is a sample server celler server.",
  284. InfoInstanceName: "swagger",
  285. SwaggerTemplate: docTemplate,
  286. LeftDelim: "{{",
  287. RightDelim: "}}",
  288. }
  289. func init() {
  290. swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
  291. }