You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

338 lines
9.6 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag at
  3. // 2019-09-07 22:49:45.2497438 +0800 CST m=+0.040919801
  4. package docs
  5. import (
  6. "bytes"
  7. "encoding/json"
  8. "strings"
  9. "github.com/alecthomas/template"
  10. "github.com/swaggo/swag"
  11. )
  12. var doc = `{
  13. "schemes": {{ marshal .Schemes }},
  14. "swagger": "2.0",
  15. "info": {
  16. "description": "{{.Description}}",
  17. "title": "{{.Title}}",
  18. "contact": {},
  19. "license": {},
  20. "version": "{{.Version}}"
  21. },
  22. "host": "{{.Host}}",
  23. "basePath": "{{.BasePath}}",
  24. "paths": {
  25. "/base/login": {
  26. "post": {
  27. "produces": [
  28. "application/json"
  29. ],
  30. "tags": [
  31. "Base"
  32. ],
  33. "summary": "用户登录",
  34. "parameters": [
  35. {
  36. "description": "用户登录接口",
  37. "name": "data",
  38. "in": "body",
  39. "required": true,
  40. "schema": {
  41. "type": "object",
  42. "$ref": "#/definitions/api.RegistAndLoginStuct"
  43. }
  44. }
  45. ],
  46. "responses": {
  47. "200": {
  48. "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}",
  49. "schema": {
  50. "type": "string"
  51. }
  52. }
  53. }
  54. }
  55. },
  56. "/base/regist": {
  57. "post": {
  58. "produces": [
  59. "application/json"
  60. ],
  61. "tags": [
  62. "Base"
  63. ],
  64. "summary": "用户注册账号",
  65. "parameters": [
  66. {
  67. "description": "用户注册接口",
  68. "name": "data",
  69. "in": "body",
  70. "required": true,
  71. "schema": {
  72. "type": "object",
  73. "$ref": "#/definitions/api.RegistAndLoginStuct"
  74. }
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}",
  80. "schema": {
  81. "type": "string"
  82. }
  83. }
  84. }
  85. }
  86. },
  87. "/menu/getMenu": {
  88. "post": {
  89. "security": [
  90. {
  91. "ApiKeyAuth": []
  92. }
  93. ],
  94. "produces": [
  95. "application/json"
  96. ],
  97. "tags": [
  98. "Menu"
  99. ],
  100. "summary": "获取用户动态路由",
  101. "parameters": [
  102. {
  103. "description": "可以什么都不填",
  104. "name": "data",
  105. "in": "body",
  106. "required": true,
  107. "schema": {
  108. "type": "object",
  109. "$ref": "#/definitions/api.RegistAndLoginStuct"
  110. }
  111. }
  112. ],
  113. "responses": {
  114. "200": {
  115. "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}",
  116. "schema": {
  117. "type": "string"
  118. }
  119. }
  120. }
  121. }
  122. },
  123. "/user/changePassWord": {
  124. "post": {
  125. "security": [
  126. {
  127. "ApiKeyAuth": []
  128. }
  129. ],
  130. "produces": [
  131. "application/json"
  132. ],
  133. "tags": [
  134. "User"
  135. ],
  136. "summary": "用户修改密码",
  137. "parameters": [
  138. {
  139. "description": "用户修改密码",
  140. "name": "data",
  141. "in": "body",
  142. "required": true,
  143. "schema": {
  144. "type": "object",
  145. "$ref": "#/definitions/api.ChangePassWordStutrc"
  146. }
  147. }
  148. ],
  149. "responses": {
  150. "200": {
  151. "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}",
  152. "schema": {
  153. "type": "string"
  154. }
  155. }
  156. }
  157. }
  158. },
  159. "/user/getInfoList": {
  160. "post": {
  161. "security": [
  162. {
  163. "ApiKeyAuth": []
  164. }
  165. ],
  166. "consumes": [
  167. "application/json"
  168. ],
  169. "produces": [
  170. "application/json"
  171. ],
  172. "tags": [
  173. "User"
  174. ],
  175. "summary": "分页获取用户列表",
  176. "parameters": [
  177. {
  178. "description": "分页获取用户列表",
  179. "name": "data",
  180. "in": "body",
  181. "required": true,
  182. "schema": {
  183. "type": "object",
  184. "$ref": "#/definitions/modelInterface.PageInfo"
  185. }
  186. }
  187. ],
  188. "responses": {
  189. "200": {
  190. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  191. "schema": {
  192. "type": "string"
  193. }
  194. }
  195. }
  196. }
  197. },
  198. "/user/uploadHeaderImg": {
  199. "post": {
  200. "security": [
  201. {
  202. "ApiKeyAuth": []
  203. }
  204. ],
  205. "consumes": [
  206. "multipart/form-data"
  207. ],
  208. "produces": [
  209. "application/json"
  210. ],
  211. "tags": [
  212. "User"
  213. ],
  214. "summary": "用户上传头像",
  215. "parameters": [
  216. {
  217. "type": "file",
  218. "description": "用户上传头像",
  219. "name": "headerImg",
  220. "in": "formData",
  221. "required": true
  222. },
  223. {
  224. "type": "string",
  225. "description": "用户上传头像",
  226. "name": "userName",
  227. "in": "formData",
  228. "required": true
  229. }
  230. ],
  231. "responses": {
  232. "200": {
  233. "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
  234. "schema": {
  235. "type": "string"
  236. }
  237. }
  238. }
  239. }
  240. }
  241. },
  242. "definitions": {
  243. "api.ChangePassWordStutrc": {
  244. "type": "object",
  245. "properties": {
  246. "newPassWord": {
  247. "type": "string"
  248. },
  249. "passWord": {
  250. "type": "string"
  251. },
  252. "userName": {
  253. "type": "string"
  254. }
  255. }
  256. },
  257. "api.RegistAndLoginStuct": {
  258. "type": "object",
  259. "properties": {
  260. "passWord": {
  261. "type": "string"
  262. },
  263. "userName": {
  264. "type": "string"
  265. }
  266. }
  267. },
  268. "modelInterface.PageInfo": {
  269. "type": "object",
  270. "properties": {
  271. "page": {
  272. "type": "integer"
  273. },
  274. "pageSize": {
  275. "type": "integer"
  276. }
  277. }
  278. }
  279. },
  280. "securityDefinitions": {
  281. "ApiKeyAuth": {
  282. "type": "apiKey",
  283. "name": "x-token",
  284. "in": "header"
  285. }
  286. }
  287. }`
  288. type swaggerInfo struct {
  289. Version string
  290. Host string
  291. BasePath string
  292. Schemes []string
  293. Title string
  294. Description string
  295. }
  296. // SwaggerInfo holds exported Swagger Info so clients can modify it
  297. var SwaggerInfo = swaggerInfo{
  298. Version: "0.0.1",
  299. Host: "",
  300. BasePath: "/",
  301. Schemes: []string{},
  302. Title: "Swagger Example API",
  303. Description: "This is a sample Server pets",
  304. }
  305. type s struct{}
  306. func (s *s) ReadDoc() string {
  307. sInfo := SwaggerInfo
  308. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  309. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  310. "marshal": func(v interface{}) string {
  311. a, _ := json.Marshal(v)
  312. return string(a)
  313. },
  314. }).Parse(doc)
  315. if err != nil {
  316. return doc
  317. }
  318. var tpl bytes.Buffer
  319. if err := t.Execute(&tpl, sInfo); err != nil {
  320. return doc
  321. }
  322. return tpl.String()
  323. }
  324. func init() {
  325. swag.Register(swag.Name, &s{})
  326. }