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.

491 lines
14 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
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-08 16:14:12.6903257 +0800 CST m=+0.106563301
  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. "/api/createApi": {
  26. "post": {
  27. "security": [
  28. {
  29. "ApiKeyAuth": []
  30. }
  31. ],
  32. "consumes": [
  33. "application/json"
  34. ],
  35. "produces": [
  36. "application/json"
  37. ],
  38. "tags": [
  39. "Api"
  40. ],
  41. "summary": "为指定角色创建api",
  42. "parameters": [
  43. {
  44. "description": "创建api",
  45. "name": "data",
  46. "in": "body",
  47. "required": true,
  48. "schema": {
  49. "type": "object",
  50. "$ref": "#/definitions/api.CreateApiParams"
  51. }
  52. }
  53. ],
  54. "responses": {
  55. "200": {
  56. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  57. "schema": {
  58. "type": "string"
  59. }
  60. }
  61. }
  62. }
  63. },
  64. "/api/deleteApi": {
  65. "post": {
  66. "security": [
  67. {
  68. "ApiKeyAuth": []
  69. }
  70. ],
  71. "consumes": [
  72. "application/json"
  73. ],
  74. "produces": [
  75. "application/json"
  76. ],
  77. "tags": [
  78. "Api"
  79. ],
  80. "summary": "删除指定角色api",
  81. "parameters": [
  82. {
  83. "description": "删除api",
  84. "name": "data",
  85. "in": "body",
  86. "required": true,
  87. "schema": {
  88. "type": "object",
  89. "$ref": "#/definitions/api.DeleteApiParams"
  90. }
  91. }
  92. ],
  93. "responses": {
  94. "200": {
  95. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  96. "schema": {
  97. "type": "string"
  98. }
  99. }
  100. }
  101. }
  102. },
  103. "/authority/createAuthority": {
  104. "post": {
  105. "security": [
  106. {
  107. "ApiKeyAuth": []
  108. }
  109. ],
  110. "consumes": [
  111. "application/json"
  112. ],
  113. "produces": [
  114. "application/json"
  115. ],
  116. "tags": [
  117. "authority"
  118. ],
  119. "summary": "创建角色",
  120. "parameters": [
  121. {
  122. "description": "创建角色",
  123. "name": "data",
  124. "in": "body",
  125. "required": true,
  126. "schema": {
  127. "type": "object",
  128. "$ref": "#/definitions/api.CreateAuthorityPatams"
  129. }
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  135. "schema": {
  136. "type": "string"
  137. }
  138. }
  139. }
  140. }
  141. },
  142. "/authority/deleteAuthority": {
  143. "post": {
  144. "security": [
  145. {
  146. "ApiKeyAuth": []
  147. }
  148. ],
  149. "consumes": [
  150. "application/json"
  151. ],
  152. "produces": [
  153. "application/json"
  154. ],
  155. "tags": [
  156. "authority"
  157. ],
  158. "summary": "删除角色",
  159. "parameters": [
  160. {
  161. "description": "删除角色",
  162. "name": "data",
  163. "in": "body",
  164. "required": true,
  165. "schema": {
  166. "type": "object",
  167. "$ref": "#/definitions/api.DeleteAuthorityPatams"
  168. }
  169. }
  170. ],
  171. "responses": {
  172. "200": {
  173. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  174. "schema": {
  175. "type": "string"
  176. }
  177. }
  178. }
  179. }
  180. },
  181. "/base/login": {
  182. "post": {
  183. "produces": [
  184. "application/json"
  185. ],
  186. "tags": [
  187. "Base"
  188. ],
  189. "summary": "用户登录",
  190. "parameters": [
  191. {
  192. "description": "用户登录接口",
  193. "name": "data",
  194. "in": "body",
  195. "required": true,
  196. "schema": {
  197. "type": "object",
  198. "$ref": "#/definitions/api.RegistAndLoginStuct"
  199. }
  200. }
  201. ],
  202. "responses": {
  203. "200": {
  204. "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}",
  205. "schema": {
  206. "type": "string"
  207. }
  208. }
  209. }
  210. }
  211. },
  212. "/base/regist": {
  213. "post": {
  214. "produces": [
  215. "application/json"
  216. ],
  217. "tags": [
  218. "Base"
  219. ],
  220. "summary": "用户注册账号",
  221. "parameters": [
  222. {
  223. "description": "用户注册接口",
  224. "name": "data",
  225. "in": "body",
  226. "required": true,
  227. "schema": {
  228. "type": "object",
  229. "$ref": "#/definitions/api.RegistAndLoginStuct"
  230. }
  231. }
  232. ],
  233. "responses": {
  234. "200": {
  235. "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}",
  236. "schema": {
  237. "type": "string"
  238. }
  239. }
  240. }
  241. }
  242. },
  243. "/user/changePassword": {
  244. "post": {
  245. "security": [
  246. {
  247. "ApiKeyAuth": []
  248. }
  249. ],
  250. "produces": [
  251. "application/json"
  252. ],
  253. "tags": [
  254. "User"
  255. ],
  256. "summary": "用户修改密码",
  257. "parameters": [
  258. {
  259. "description": "用户修改密码",
  260. "name": "data",
  261. "in": "body",
  262. "required": true,
  263. "schema": {
  264. "type": "object",
  265. "$ref": "#/definitions/api.ChangePasswordStutrc"
  266. }
  267. }
  268. ],
  269. "responses": {
  270. "200": {
  271. "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}",
  272. "schema": {
  273. "type": "string"
  274. }
  275. }
  276. }
  277. }
  278. },
  279. "/user/getInfoList": {
  280. "post": {
  281. "security": [
  282. {
  283. "ApiKeyAuth": []
  284. }
  285. ],
  286. "consumes": [
  287. "application/json"
  288. ],
  289. "produces": [
  290. "application/json"
  291. ],
  292. "tags": [
  293. "User"
  294. ],
  295. "summary": "分页获取用户列表",
  296. "parameters": [
  297. {
  298. "description": "分页获取用户列表",
  299. "name": "data",
  300. "in": "body",
  301. "required": true,
  302. "schema": {
  303. "type": "object",
  304. "$ref": "#/definitions/modelInterface.PageInfo"
  305. }
  306. }
  307. ],
  308. "responses": {
  309. "200": {
  310. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  311. "schema": {
  312. "type": "string"
  313. }
  314. }
  315. }
  316. }
  317. },
  318. "/user/uploadHeaderImg": {
  319. "post": {
  320. "security": [
  321. {
  322. "ApiKeyAuth": []
  323. }
  324. ],
  325. "consumes": [
  326. "multipart/form-data"
  327. ],
  328. "produces": [
  329. "application/json"
  330. ],
  331. "tags": [
  332. "User"
  333. ],
  334. "summary": "用户上传头像",
  335. "parameters": [
  336. {
  337. "type": "file",
  338. "description": "用户上传头像",
  339. "name": "headerImg",
  340. "in": "formData",
  341. "required": true
  342. },
  343. {
  344. "type": "string",
  345. "description": "用户上传头像",
  346. "name": "username",
  347. "in": "formData",
  348. "required": true
  349. }
  350. ],
  351. "responses": {
  352. "200": {
  353. "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
  354. "schema": {
  355. "type": "string"
  356. }
  357. }
  358. }
  359. }
  360. }
  361. },
  362. "definitions": {
  363. "api.ChangePasswordStutrc": {
  364. "type": "object",
  365. "properties": {
  366. "newPassword": {
  367. "type": "string"
  368. },
  369. "password": {
  370. "type": "string"
  371. },
  372. "username": {
  373. "type": "string"
  374. }
  375. }
  376. },
  377. "api.CreateApiParams": {
  378. "type": "object",
  379. "properties": {
  380. "description": {
  381. "type": "string"
  382. },
  383. "path": {
  384. "type": "string"
  385. }
  386. }
  387. },
  388. "api.CreateAuthorityPatams": {
  389. "type": "object",
  390. "properties": {
  391. "authorityId": {
  392. "type": "integer"
  393. },
  394. "authorityName": {
  395. "type": "string"
  396. }
  397. }
  398. },
  399. "api.DeleteApiParams": {
  400. "type": "object"
  401. },
  402. "api.DeleteAuthorityPatams": {
  403. "type": "object",
  404. "properties": {
  405. "authorityId": {
  406. "type": "integer"
  407. }
  408. }
  409. },
  410. "api.RegistAndLoginStuct": {
  411. "type": "object",
  412. "properties": {
  413. "password": {
  414. "type": "string"
  415. },
  416. "username": {
  417. "type": "string"
  418. }
  419. }
  420. },
  421. "modelInterface.PageInfo": {
  422. "type": "object",
  423. "properties": {
  424. "page": {
  425. "type": "integer"
  426. },
  427. "pageSize": {
  428. "type": "integer"
  429. }
  430. }
  431. }
  432. },
  433. "securityDefinitions": {
  434. "ApiKeyAuth": {
  435. "type": "apiKey",
  436. "name": "x-token",
  437. "in": "header"
  438. }
  439. }
  440. }`
  441. type swaggerInfo struct {
  442. Version string
  443. Host string
  444. BasePath string
  445. Schemes []string
  446. Title string
  447. Description string
  448. }
  449. // SwaggerInfo holds exported Swagger Info so clients can modify it
  450. var SwaggerInfo = swaggerInfo{
  451. Version: "0.0.1",
  452. Host: "",
  453. BasePath: "/",
  454. Schemes: []string{},
  455. Title: "Swagger Example API",
  456. Description: "This is a sample Server pets",
  457. }
  458. type s struct{}
  459. func (s *s) ReadDoc() string {
  460. sInfo := SwaggerInfo
  461. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  462. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  463. "marshal": func(v interface{}) string {
  464. a, _ := json.Marshal(v)
  465. return string(a)
  466. },
  467. }).Parse(doc)
  468. if err != nil {
  469. return doc
  470. }
  471. var tpl bytes.Buffer
  472. if err := t.Execute(&tpl, sInfo); err != nil {
  473. return doc
  474. }
  475. return tpl.String()
  476. }
  477. func init() {
  478. swag.Register(swag.Name, &s{})
  479. }