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.

931 lines
28 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
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-22 17:09:11.1201116 +0800 CST m=+0.066820301
  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. "/api/getApiList": {
  104. "post": {
  105. "security": [
  106. {
  107. "ApiKeyAuth": []
  108. }
  109. ],
  110. "consumes": [
  111. "application/json"
  112. ],
  113. "produces": [
  114. "application/json"
  115. ],
  116. "tags": [
  117. "Api"
  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/modelInterface.PageInfo"
  129. }
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  135. "schema": {
  136. "type": "string"
  137. }
  138. }
  139. }
  140. }
  141. },
  142. "/api/setAuthAndPath": {
  143. "post": {
  144. "security": [
  145. {
  146. "ApiKeyAuth": []
  147. }
  148. ],
  149. "consumes": [
  150. "application/json"
  151. ],
  152. "produces": [
  153. "application/json"
  154. ],
  155. "tags": [
  156. "Api"
  157. ],
  158. "summary": "创建api和角色关系",
  159. "parameters": [
  160. {
  161. "description": "创建api和角色关系",
  162. "name": "data",
  163. "in": "body",
  164. "required": true,
  165. "schema": {
  166. "type": "object",
  167. "$ref": "#/definitions/api.AuthAndPathIn"
  168. }
  169. }
  170. ],
  171. "responses": {
  172. "200": {
  173. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  174. "schema": {
  175. "type": "string"
  176. }
  177. }
  178. }
  179. }
  180. },
  181. "/authority/createAuthority": {
  182. "post": {
  183. "security": [
  184. {
  185. "ApiKeyAuth": []
  186. }
  187. ],
  188. "consumes": [
  189. "application/json"
  190. ],
  191. "produces": [
  192. "application/json"
  193. ],
  194. "tags": [
  195. "authority"
  196. ],
  197. "summary": "创建角色",
  198. "parameters": [
  199. {
  200. "description": "创建角色",
  201. "name": "data",
  202. "in": "body",
  203. "required": true,
  204. "schema": {
  205. "type": "object",
  206. "$ref": "#/definitions/api.CreateAuthorityPatams"
  207. }
  208. }
  209. ],
  210. "responses": {
  211. "200": {
  212. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  213. "schema": {
  214. "type": "string"
  215. }
  216. }
  217. }
  218. }
  219. },
  220. "/authority/deleteAuthority": {
  221. "post": {
  222. "security": [
  223. {
  224. "ApiKeyAuth": []
  225. }
  226. ],
  227. "consumes": [
  228. "application/json"
  229. ],
  230. "produces": [
  231. "application/json"
  232. ],
  233. "tags": [
  234. "authority"
  235. ],
  236. "summary": "删除角色",
  237. "parameters": [
  238. {
  239. "description": "删除角色",
  240. "name": "data",
  241. "in": "body",
  242. "required": true,
  243. "schema": {
  244. "type": "object",
  245. "$ref": "#/definitions/api.DeleteAuthorityPatams"
  246. }
  247. }
  248. ],
  249. "responses": {
  250. "200": {
  251. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  252. "schema": {
  253. "type": "string"
  254. }
  255. }
  256. }
  257. }
  258. },
  259. "/authority/getAuthorityList": {
  260. "post": {
  261. "security": [
  262. {
  263. "ApiKeyAuth": []
  264. }
  265. ],
  266. "consumes": [
  267. "application/json"
  268. ],
  269. "produces": [
  270. "application/json"
  271. ],
  272. "tags": [
  273. "authority"
  274. ],
  275. "summary": "分页获取角色列表",
  276. "parameters": [
  277. {
  278. "description": "分页获取用户列表",
  279. "name": "data",
  280. "in": "body",
  281. "required": true,
  282. "schema": {
  283. "type": "object",
  284. "$ref": "#/definitions/modelInterface.PageInfo"
  285. }
  286. }
  287. ],
  288. "responses": {
  289. "200": {
  290. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  291. "schema": {
  292. "type": "string"
  293. }
  294. }
  295. }
  296. }
  297. },
  298. "/base/login": {
  299. "post": {
  300. "produces": [
  301. "application/json"
  302. ],
  303. "tags": [
  304. "Base"
  305. ],
  306. "summary": "用户登录",
  307. "parameters": [
  308. {
  309. "description": "用户登录接口",
  310. "name": "data",
  311. "in": "body",
  312. "required": true,
  313. "schema": {
  314. "type": "object",
  315. "$ref": "#/definitions/api.RegistAndLoginStuct"
  316. }
  317. }
  318. ],
  319. "responses": {
  320. "200": {
  321. "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}",
  322. "schema": {
  323. "type": "string"
  324. }
  325. }
  326. }
  327. }
  328. },
  329. "/base/regist": {
  330. "post": {
  331. "produces": [
  332. "application/json"
  333. ],
  334. "tags": [
  335. "Base"
  336. ],
  337. "summary": "用户注册账号",
  338. "parameters": [
  339. {
  340. "description": "用户注册接口",
  341. "name": "data",
  342. "in": "body",
  343. "required": true,
  344. "schema": {
  345. "type": "object",
  346. "$ref": "#/definitions/api.RegistAndLoginStuct"
  347. }
  348. }
  349. ],
  350. "responses": {
  351. "200": {
  352. "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}",
  353. "schema": {
  354. "type": "string"
  355. }
  356. }
  357. }
  358. }
  359. },
  360. "/menu/addBaseMenu": {
  361. "post": {
  362. "security": [
  363. {
  364. "ApiKeyAuth": []
  365. }
  366. ],
  367. "consumes": [
  368. "application/json"
  369. ],
  370. "produces": [
  371. "application/json"
  372. ],
  373. "tags": [
  374. "menu"
  375. ],
  376. "summary": "分页获取基础menu列表",
  377. "parameters": [
  378. {
  379. "description": "分页获取基础menu列表",
  380. "name": "data",
  381. "in": "body",
  382. "required": true,
  383. "schema": {
  384. "type": "object",
  385. "$ref": "#/definitions/modelInterface.PageInfo"
  386. }
  387. }
  388. ],
  389. "responses": {
  390. "200": {
  391. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  392. "schema": {
  393. "type": "string"
  394. }
  395. }
  396. }
  397. }
  398. },
  399. "/menu/addMenuAuthority": {
  400. "post": {
  401. "security": [
  402. {
  403. "ApiKeyAuth": []
  404. }
  405. ],
  406. "consumes": [
  407. "application/json"
  408. ],
  409. "produces": [
  410. "application/json"
  411. ],
  412. "tags": [
  413. "authorityAndMenu"
  414. ],
  415. "summary": "获取指定角色menu",
  416. "parameters": [
  417. {
  418. "description": "增加menu和角色关联关系",
  419. "name": "data",
  420. "in": "body",
  421. "required": true,
  422. "schema": {
  423. "type": "object",
  424. "$ref": "#/definitions/api.AuthorityIdInfo"
  425. }
  426. }
  427. ],
  428. "responses": {
  429. "200": {
  430. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  431. "schema": {
  432. "type": "string"
  433. }
  434. }
  435. }
  436. }
  437. },
  438. "/menu/deleteBaseMenu": {
  439. "post": {
  440. "security": [
  441. {
  442. "ApiKeyAuth": []
  443. }
  444. ],
  445. "consumes": [
  446. "application/json"
  447. ],
  448. "produces": [
  449. "application/json"
  450. ],
  451. "tags": [
  452. "menu"
  453. ],
  454. "summary": "获取指定角色menu",
  455. "parameters": [
  456. {
  457. "description": "删除菜单",
  458. "name": "data",
  459. "in": "body",
  460. "required": true,
  461. "schema": {
  462. "type": "object",
  463. "$ref": "#/definitions/api.IdInfo"
  464. }
  465. }
  466. ],
  467. "responses": {
  468. "200": {
  469. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  470. "schema": {
  471. "type": "string"
  472. }
  473. }
  474. }
  475. }
  476. },
  477. "/menu/getBaseMenuTree": {
  478. "post": {
  479. "security": [
  480. {
  481. "ApiKeyAuth": []
  482. }
  483. ],
  484. "produces": [
  485. "application/json"
  486. ],
  487. "tags": [
  488. "authorityAndMenu"
  489. ],
  490. "summary": "获取用户动态路由",
  491. "parameters": [
  492. {
  493. "description": "可以什么都不填",
  494. "name": "data",
  495. "in": "body",
  496. "required": true,
  497. "schema": {
  498. "type": "object",
  499. "$ref": "#/definitions/api.RegistAndLoginStuct"
  500. }
  501. }
  502. ],
  503. "responses": {
  504. "200": {
  505. "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}",
  506. "schema": {
  507. "type": "string"
  508. }
  509. }
  510. }
  511. }
  512. },
  513. "/menu/getMenu": {
  514. "post": {
  515. "security": [
  516. {
  517. "ApiKeyAuth": []
  518. }
  519. ],
  520. "produces": [
  521. "application/json"
  522. ],
  523. "tags": [
  524. "authorityAndMenu"
  525. ],
  526. "summary": "获取用户动态路由",
  527. "parameters": [
  528. {
  529. "description": "可以什么都不填",
  530. "name": "data",
  531. "in": "body",
  532. "required": true,
  533. "schema": {
  534. "type": "object",
  535. "$ref": "#/definitions/api.RegistAndLoginStuct"
  536. }
  537. }
  538. ],
  539. "responses": {
  540. "200": {
  541. "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}",
  542. "schema": {
  543. "type": "string"
  544. }
  545. }
  546. }
  547. }
  548. },
  549. "/menu/getMenuList": {
  550. "post": {
  551. "security": [
  552. {
  553. "ApiKeyAuth": []
  554. }
  555. ],
  556. "consumes": [
  557. "application/json"
  558. ],
  559. "produces": [
  560. "application/json"
  561. ],
  562. "tags": [
  563. "menu"
  564. ],
  565. "summary": "分页获取基础menu列表",
  566. "parameters": [
  567. {
  568. "description": "分页获取基础menu列表",
  569. "name": "data",
  570. "in": "body",
  571. "required": true,
  572. "schema": {
  573. "type": "object",
  574. "$ref": "#/definitions/modelInterface.PageInfo"
  575. }
  576. }
  577. ],
  578. "responses": {
  579. "200": {
  580. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  581. "schema": {
  582. "type": "string"
  583. }
  584. }
  585. }
  586. }
  587. },
  588. "/user/changePassword": {
  589. "post": {
  590. "security": [
  591. {
  592. "ApiKeyAuth": []
  593. }
  594. ],
  595. "produces": [
  596. "application/json"
  597. ],
  598. "tags": [
  599. "User"
  600. ],
  601. "summary": "用户修改密码",
  602. "parameters": [
  603. {
  604. "description": "用户修改密码",
  605. "name": "data",
  606. "in": "body",
  607. "required": true,
  608. "schema": {
  609. "type": "object",
  610. "$ref": "#/definitions/api.ChangePasswordStutrc"
  611. }
  612. }
  613. ],
  614. "responses": {
  615. "200": {
  616. "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}",
  617. "schema": {
  618. "type": "string"
  619. }
  620. }
  621. }
  622. }
  623. },
  624. "/user/getInfoList": {
  625. "post": {
  626. "security": [
  627. {
  628. "ApiKeyAuth": []
  629. }
  630. ],
  631. "consumes": [
  632. "application/json"
  633. ],
  634. "produces": [
  635. "application/json"
  636. ],
  637. "tags": [
  638. "User"
  639. ],
  640. "summary": "分页获取用户列表",
  641. "parameters": [
  642. {
  643. "description": "分页获取用户列表",
  644. "name": "data",
  645. "in": "body",
  646. "required": true,
  647. "schema": {
  648. "type": "object",
  649. "$ref": "#/definitions/modelInterface.PageInfo"
  650. }
  651. }
  652. ],
  653. "responses": {
  654. "200": {
  655. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  656. "schema": {
  657. "type": "string"
  658. }
  659. }
  660. }
  661. }
  662. },
  663. "/user/uploadHeaderImg": {
  664. "post": {
  665. "security": [
  666. {
  667. "ApiKeyAuth": []
  668. }
  669. ],
  670. "consumes": [
  671. "multipart/form-data"
  672. ],
  673. "produces": [
  674. "application/json"
  675. ],
  676. "tags": [
  677. "User"
  678. ],
  679. "summary": "用户上传头像",
  680. "parameters": [
  681. {
  682. "type": "file",
  683. "description": "用户上传头像",
  684. "name": "headerImg",
  685. "in": "formData",
  686. "required": true
  687. },
  688. {
  689. "type": "string",
  690. "description": "用户上传头像",
  691. "name": "username",
  692. "in": "formData",
  693. "required": true
  694. }
  695. ],
  696. "responses": {
  697. "200": {
  698. "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
  699. "schema": {
  700. "type": "string"
  701. }
  702. }
  703. }
  704. }
  705. }
  706. },
  707. "definitions": {
  708. "api.AddMenuAuthorityInfo": {
  709. "type": "object",
  710. "properties": {
  711. "authorityId": {
  712. "type": "string"
  713. },
  714. "menus": {
  715. "type": "array",
  716. "items": {
  717. "$ref": "#/definitions/dbModel.BaseMenu"
  718. }
  719. }
  720. }
  721. },
  722. "api.AuthAndPathIn": {
  723. "type": "object",
  724. "properties": {
  725. "apis": {
  726. "type": "array",
  727. "items": {
  728. "$ref": "#/definitions/dbModel.Api"
  729. }
  730. },
  731. "authorityId": {
  732. "type": "string"
  733. }
  734. }
  735. },
  736. "api.AuthorityIdInfo": {
  737. "type": "object",
  738. "properties": {
  739. "authorityId": {
  740. "type": "string"
  741. }
  742. }
  743. },
  744. "api.ChangePasswordStutrc": {
  745. "type": "object",
  746. "properties": {
  747. "newPassword": {
  748. "type": "string"
  749. },
  750. "password": {
  751. "type": "string"
  752. },
  753. "username": {
  754. "type": "string"
  755. }
  756. }
  757. },
  758. "api.CreateApiParams": {
  759. "type": "object",
  760. "properties": {
  761. "description": {
  762. "type": "string"
  763. },
  764. "path": {
  765. "type": "string"
  766. }
  767. }
  768. },
  769. "api.CreateAuthorityPatams": {
  770. "type": "object",
  771. "properties": {
  772. "authorityId": {
  773. "type": "string"
  774. },
  775. "authorityName": {
  776. "type": "string"
  777. }
  778. }
  779. },
  780. "api.DeleteApiParams": {
  781. "type": "object",
  782. "properties": {
  783. "path": {
  784. "type": "integer"
  785. }
  786. }
  787. },
  788. "api.DeleteAuthorityPatams": {
  789. "type": "object",
  790. "properties": {
  791. "authorityId": {
  792. "type": "integer"
  793. }
  794. }
  795. },
  796. "api.IdInfo": {
  797. "type": "object",
  798. "properties": {
  799. "id": {
  800. "type": "number"
  801. }
  802. }
  803. },
  804. "api.RegistAndLoginStuct": {
  805. "type": "object",
  806. "properties": {
  807. "password": {
  808. "type": "string"
  809. },
  810. "username": {
  811. "type": "string"
  812. }
  813. }
  814. },
  815. "dbModel.Api": {
  816. "type": "object",
  817. "properties": {
  818. "description": {
  819. "type": "string"
  820. },
  821. "path": {
  822. "type": "string"
  823. }
  824. }
  825. },
  826. "dbModel.BaseMenu": {
  827. "type": "object",
  828. "properties": {
  829. "children": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/definitions/dbModel.BaseMenu"
  833. }
  834. },
  835. "component": {
  836. "type": "string"
  837. },
  838. "hidden": {
  839. "type": "boolean"
  840. },
  841. "icon": {
  842. "type": "string"
  843. },
  844. "name": {
  845. "type": "string"
  846. },
  847. "nickName": {
  848. "type": "string"
  849. },
  850. "parentId": {
  851. "type": "string"
  852. },
  853. "path": {
  854. "type": "string"
  855. },
  856. "title": {
  857. "type": "string"
  858. }
  859. }
  860. },
  861. "modelInterface.PageInfo": {
  862. "type": "object",
  863. "properties": {
  864. "page": {
  865. "type": "integer"
  866. },
  867. "pageSize": {
  868. "type": "integer"
  869. }
  870. }
  871. }
  872. },
  873. "securityDefinitions": {
  874. "ApiKeyAuth": {
  875. "type": "apiKey",
  876. "name": "x-token",
  877. "in": "header"
  878. }
  879. }
  880. }`
  881. type swaggerInfo struct {
  882. Version string
  883. Host string
  884. BasePath string
  885. Schemes []string
  886. Title string
  887. Description string
  888. }
  889. // SwaggerInfo holds exported Swagger Info so clients can modify it
  890. var SwaggerInfo = swaggerInfo{
  891. Version: "0.0.1",
  892. Host: "",
  893. BasePath: "/",
  894. Schemes: []string{},
  895. Title: "Swagger Example API",
  896. Description: "This is a sample Server pets",
  897. }
  898. type s struct{}
  899. func (s *s) ReadDoc() string {
  900. sInfo := SwaggerInfo
  901. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  902. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  903. "marshal": func(v interface{}) string {
  904. a, _ := json.Marshal(v)
  905. return string(a)
  906. },
  907. }).Parse(doc)
  908. if err != nil {
  909. return doc
  910. }
  911. var tpl bytes.Buffer
  912. if err := t.Execute(&tpl, sInfo); err != nil {
  913. return doc
  914. }
  915. return tpl.String()
  916. }
  917. func init() {
  918. swag.Register(swag.Name, &s{})
  919. }