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.

866 lines
27 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
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "This is a sample Server pets",
  5. "title": "Swagger Example API",
  6. "contact": {},
  7. "license": {},
  8. "version": "0.0.1"
  9. },
  10. "basePath": "/",
  11. "paths": {
  12. "/api/createApi": {
  13. "post": {
  14. "security": [
  15. {
  16. "ApiKeyAuth": []
  17. }
  18. ],
  19. "consumes": [
  20. "application/json"
  21. ],
  22. "produces": [
  23. "application/json"
  24. ],
  25. "tags": [
  26. "Api"
  27. ],
  28. "summary": "创建基础api",
  29. "parameters": [
  30. {
  31. "description": "创建api",
  32. "name": "data",
  33. "in": "body",
  34. "required": true,
  35. "schema": {
  36. "type": "object",
  37. "$ref": "#/definitions/api.CreateApiParams"
  38. }
  39. }
  40. ],
  41. "responses": {
  42. "200": {
  43. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  44. "schema": {
  45. "type": "string"
  46. }
  47. }
  48. }
  49. }
  50. },
  51. "/api/deleteApi": {
  52. "post": {
  53. "security": [
  54. {
  55. "ApiKeyAuth": []
  56. }
  57. ],
  58. "consumes": [
  59. "application/json"
  60. ],
  61. "produces": [
  62. "application/json"
  63. ],
  64. "tags": [
  65. "Api"
  66. ],
  67. "summary": "删除指定api",
  68. "parameters": [
  69. {
  70. "description": "删除api",
  71. "name": "data",
  72. "in": "body",
  73. "required": true,
  74. "schema": {
  75. "type": "object",
  76. "$ref": "#/definitions/api.DeleteApiParams"
  77. }
  78. }
  79. ],
  80. "responses": {
  81. "200": {
  82. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  83. "schema": {
  84. "type": "string"
  85. }
  86. }
  87. }
  88. }
  89. },
  90. "/api/getApiList": {
  91. "post": {
  92. "security": [
  93. {
  94. "ApiKeyAuth": []
  95. }
  96. ],
  97. "consumes": [
  98. "application/json"
  99. ],
  100. "produces": [
  101. "application/json"
  102. ],
  103. "tags": [
  104. "Api"
  105. ],
  106. "summary": "分页获取角色列表",
  107. "parameters": [
  108. {
  109. "description": "分页获取用户列表",
  110. "name": "data",
  111. "in": "body",
  112. "required": true,
  113. "schema": {
  114. "type": "object",
  115. "$ref": "#/definitions/modelInterface.PageInfo"
  116. }
  117. }
  118. ],
  119. "responses": {
  120. "200": {
  121. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  122. "schema": {
  123. "type": "string"
  124. }
  125. }
  126. }
  127. }
  128. },
  129. "/api/setAuthAndPath": {
  130. "post": {
  131. "security": [
  132. {
  133. "ApiKeyAuth": []
  134. }
  135. ],
  136. "consumes": [
  137. "application/json"
  138. ],
  139. "produces": [
  140. "application/json"
  141. ],
  142. "tags": [
  143. "Api"
  144. ],
  145. "summary": "创建api和角色关系",
  146. "parameters": [
  147. {
  148. "description": "创建api和角色关系",
  149. "name": "data",
  150. "in": "body",
  151. "required": true,
  152. "schema": {
  153. "type": "object",
  154. "$ref": "#/definitions/api.AuthAndPathIn"
  155. }
  156. }
  157. ],
  158. "responses": {
  159. "200": {
  160. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  161. "schema": {
  162. "type": "string"
  163. }
  164. }
  165. }
  166. }
  167. },
  168. "/authority/createAuthority": {
  169. "post": {
  170. "security": [
  171. {
  172. "ApiKeyAuth": []
  173. }
  174. ],
  175. "consumes": [
  176. "application/json"
  177. ],
  178. "produces": [
  179. "application/json"
  180. ],
  181. "tags": [
  182. "authority"
  183. ],
  184. "summary": "创建角色",
  185. "parameters": [
  186. {
  187. "description": "创建角色",
  188. "name": "data",
  189. "in": "body",
  190. "required": true,
  191. "schema": {
  192. "type": "object",
  193. "$ref": "#/definitions/api.CreateAuthorityPatams"
  194. }
  195. }
  196. ],
  197. "responses": {
  198. "200": {
  199. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  200. "schema": {
  201. "type": "string"
  202. }
  203. }
  204. }
  205. }
  206. },
  207. "/authority/deleteAuthority": {
  208. "post": {
  209. "security": [
  210. {
  211. "ApiKeyAuth": []
  212. }
  213. ],
  214. "consumes": [
  215. "application/json"
  216. ],
  217. "produces": [
  218. "application/json"
  219. ],
  220. "tags": [
  221. "authority"
  222. ],
  223. "summary": "删除角色",
  224. "parameters": [
  225. {
  226. "description": "删除角色",
  227. "name": "data",
  228. "in": "body",
  229. "required": true,
  230. "schema": {
  231. "type": "object",
  232. "$ref": "#/definitions/api.DeleteAuthorityPatams"
  233. }
  234. }
  235. ],
  236. "responses": {
  237. "200": {
  238. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  239. "schema": {
  240. "type": "string"
  241. }
  242. }
  243. }
  244. }
  245. },
  246. "/authority/getAuthorityList": {
  247. "post": {
  248. "security": [
  249. {
  250. "ApiKeyAuth": []
  251. }
  252. ],
  253. "consumes": [
  254. "application/json"
  255. ],
  256. "produces": [
  257. "application/json"
  258. ],
  259. "tags": [
  260. "authority"
  261. ],
  262. "summary": "分页获取角色列表",
  263. "parameters": [
  264. {
  265. "description": "分页获取用户列表",
  266. "name": "data",
  267. "in": "body",
  268. "required": true,
  269. "schema": {
  270. "type": "object",
  271. "$ref": "#/definitions/modelInterface.PageInfo"
  272. }
  273. }
  274. ],
  275. "responses": {
  276. "200": {
  277. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  278. "schema": {
  279. "type": "string"
  280. }
  281. }
  282. }
  283. }
  284. },
  285. "/base/login": {
  286. "post": {
  287. "produces": [
  288. "application/json"
  289. ],
  290. "tags": [
  291. "Base"
  292. ],
  293. "summary": "用户登录",
  294. "parameters": [
  295. {
  296. "description": "用户登录接口",
  297. "name": "data",
  298. "in": "body",
  299. "required": true,
  300. "schema": {
  301. "type": "object",
  302. "$ref": "#/definitions/api.RegistAndLoginStuct"
  303. }
  304. }
  305. ],
  306. "responses": {
  307. "200": {
  308. "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}",
  309. "schema": {
  310. "type": "string"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "/base/regist": {
  317. "post": {
  318. "produces": [
  319. "application/json"
  320. ],
  321. "tags": [
  322. "Base"
  323. ],
  324. "summary": "用户注册账号",
  325. "parameters": [
  326. {
  327. "description": "用户注册接口",
  328. "name": "data",
  329. "in": "body",
  330. "required": true,
  331. "schema": {
  332. "type": "object",
  333. "$ref": "#/definitions/api.RegistAndLoginStuct"
  334. }
  335. }
  336. ],
  337. "responses": {
  338. "200": {
  339. "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}",
  340. "schema": {
  341. "type": "string"
  342. }
  343. }
  344. }
  345. }
  346. },
  347. "/menu/addBaseMenu": {
  348. "post": {
  349. "security": [
  350. {
  351. "ApiKeyAuth": []
  352. }
  353. ],
  354. "consumes": [
  355. "application/json"
  356. ],
  357. "produces": [
  358. "application/json"
  359. ],
  360. "tags": [
  361. "menu"
  362. ],
  363. "summary": "分页获取基础menu列表",
  364. "parameters": [
  365. {
  366. "description": "分页获取基础menu列表",
  367. "name": "data",
  368. "in": "body",
  369. "required": true,
  370. "schema": {
  371. "type": "object",
  372. "$ref": "#/definitions/modelInterface.PageInfo"
  373. }
  374. }
  375. ],
  376. "responses": {
  377. "200": {
  378. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  379. "schema": {
  380. "type": "string"
  381. }
  382. }
  383. }
  384. }
  385. },
  386. "/menu/addMenuAuthority": {
  387. "post": {
  388. "security": [
  389. {
  390. "ApiKeyAuth": []
  391. }
  392. ],
  393. "consumes": [
  394. "application/json"
  395. ],
  396. "produces": [
  397. "application/json"
  398. ],
  399. "tags": [
  400. "authorityAndMenu"
  401. ],
  402. "summary": "获取指定角色menu",
  403. "parameters": [
  404. {
  405. "description": "增加menu和角色关联关系",
  406. "name": "data",
  407. "in": "body",
  408. "required": true,
  409. "schema": {
  410. "type": "object",
  411. "$ref": "#/definitions/api.AuthorityIdInfo"
  412. }
  413. }
  414. ],
  415. "responses": {
  416. "200": {
  417. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  418. "schema": {
  419. "type": "string"
  420. }
  421. }
  422. }
  423. }
  424. },
  425. "/menu/deleteBaseMenu": {
  426. "post": {
  427. "security": [
  428. {
  429. "ApiKeyAuth": []
  430. }
  431. ],
  432. "consumes": [
  433. "application/json"
  434. ],
  435. "produces": [
  436. "application/json"
  437. ],
  438. "tags": [
  439. "menu"
  440. ],
  441. "summary": "获取指定角色menu",
  442. "parameters": [
  443. {
  444. "description": "删除菜单",
  445. "name": "data",
  446. "in": "body",
  447. "required": true,
  448. "schema": {
  449. "type": "object",
  450. "$ref": "#/definitions/api.IdInfo"
  451. }
  452. }
  453. ],
  454. "responses": {
  455. "200": {
  456. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  457. "schema": {
  458. "type": "string"
  459. }
  460. }
  461. }
  462. }
  463. },
  464. "/menu/getBaseMenuTree": {
  465. "post": {
  466. "security": [
  467. {
  468. "ApiKeyAuth": []
  469. }
  470. ],
  471. "produces": [
  472. "application/json"
  473. ],
  474. "tags": [
  475. "authorityAndMenu"
  476. ],
  477. "summary": "获取用户动态路由",
  478. "parameters": [
  479. {
  480. "description": "可以什么都不填",
  481. "name": "data",
  482. "in": "body",
  483. "required": true,
  484. "schema": {
  485. "type": "object",
  486. "$ref": "#/definitions/api.RegistAndLoginStuct"
  487. }
  488. }
  489. ],
  490. "responses": {
  491. "200": {
  492. "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}",
  493. "schema": {
  494. "type": "string"
  495. }
  496. }
  497. }
  498. }
  499. },
  500. "/menu/getMenu": {
  501. "post": {
  502. "security": [
  503. {
  504. "ApiKeyAuth": []
  505. }
  506. ],
  507. "produces": [
  508. "application/json"
  509. ],
  510. "tags": [
  511. "authorityAndMenu"
  512. ],
  513. "summary": "获取用户动态路由",
  514. "parameters": [
  515. {
  516. "description": "可以什么都不填",
  517. "name": "data",
  518. "in": "body",
  519. "required": true,
  520. "schema": {
  521. "type": "object",
  522. "$ref": "#/definitions/api.RegistAndLoginStuct"
  523. }
  524. }
  525. ],
  526. "responses": {
  527. "200": {
  528. "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}",
  529. "schema": {
  530. "type": "string"
  531. }
  532. }
  533. }
  534. }
  535. },
  536. "/menu/getMenuList": {
  537. "post": {
  538. "security": [
  539. {
  540. "ApiKeyAuth": []
  541. }
  542. ],
  543. "consumes": [
  544. "application/json"
  545. ],
  546. "produces": [
  547. "application/json"
  548. ],
  549. "tags": [
  550. "menu"
  551. ],
  552. "summary": "分页获取基础menu列表",
  553. "parameters": [
  554. {
  555. "description": "分页获取基础menu列表",
  556. "name": "data",
  557. "in": "body",
  558. "required": true,
  559. "schema": {
  560. "type": "object",
  561. "$ref": "#/definitions/modelInterface.PageInfo"
  562. }
  563. }
  564. ],
  565. "responses": {
  566. "200": {
  567. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  568. "schema": {
  569. "type": "string"
  570. }
  571. }
  572. }
  573. }
  574. },
  575. "/user/changePassword": {
  576. "post": {
  577. "security": [
  578. {
  579. "ApiKeyAuth": []
  580. }
  581. ],
  582. "produces": [
  583. "application/json"
  584. ],
  585. "tags": [
  586. "User"
  587. ],
  588. "summary": "用户修改密码",
  589. "parameters": [
  590. {
  591. "description": "用户修改密码",
  592. "name": "data",
  593. "in": "body",
  594. "required": true,
  595. "schema": {
  596. "type": "object",
  597. "$ref": "#/definitions/api.ChangePasswordStutrc"
  598. }
  599. }
  600. ],
  601. "responses": {
  602. "200": {
  603. "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}",
  604. "schema": {
  605. "type": "string"
  606. }
  607. }
  608. }
  609. }
  610. },
  611. "/user/getInfoList": {
  612. "post": {
  613. "security": [
  614. {
  615. "ApiKeyAuth": []
  616. }
  617. ],
  618. "consumes": [
  619. "application/json"
  620. ],
  621. "produces": [
  622. "application/json"
  623. ],
  624. "tags": [
  625. "User"
  626. ],
  627. "summary": "分页获取用户列表",
  628. "parameters": [
  629. {
  630. "description": "分页获取用户列表",
  631. "name": "data",
  632. "in": "body",
  633. "required": true,
  634. "schema": {
  635. "type": "object",
  636. "$ref": "#/definitions/modelInterface.PageInfo"
  637. }
  638. }
  639. ],
  640. "responses": {
  641. "200": {
  642. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  643. "schema": {
  644. "type": "string"
  645. }
  646. }
  647. }
  648. }
  649. },
  650. "/user/uploadHeaderImg": {
  651. "post": {
  652. "security": [
  653. {
  654. "ApiKeyAuth": []
  655. }
  656. ],
  657. "consumes": [
  658. "multipart/form-data"
  659. ],
  660. "produces": [
  661. "application/json"
  662. ],
  663. "tags": [
  664. "User"
  665. ],
  666. "summary": "用户上传头像",
  667. "parameters": [
  668. {
  669. "type": "file",
  670. "description": "用户上传头像",
  671. "name": "headerImg",
  672. "in": "formData",
  673. "required": true
  674. },
  675. {
  676. "type": "string",
  677. "description": "用户上传头像",
  678. "name": "username",
  679. "in": "formData",
  680. "required": true
  681. }
  682. ],
  683. "responses": {
  684. "200": {
  685. "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
  686. "schema": {
  687. "type": "string"
  688. }
  689. }
  690. }
  691. }
  692. }
  693. },
  694. "definitions": {
  695. "api.AddMenuAuthorityInfo": {
  696. "type": "object",
  697. "properties": {
  698. "authorityId": {
  699. "type": "string"
  700. },
  701. "menus": {
  702. "type": "array",
  703. "items": {
  704. "$ref": "#/definitions/dbModel.BaseMenu"
  705. }
  706. }
  707. }
  708. },
  709. "api.AuthAndPathIn": {
  710. "type": "object",
  711. "properties": {
  712. "apis": {
  713. "type": "array",
  714. "items": {
  715. "$ref": "#/definitions/dbModel.Api"
  716. }
  717. },
  718. "authorityId": {
  719. "type": "string"
  720. }
  721. }
  722. },
  723. "api.AuthorityIdInfo": {
  724. "type": "object",
  725. "properties": {
  726. "authorityId": {
  727. "type": "string"
  728. }
  729. }
  730. },
  731. "api.ChangePasswordStutrc": {
  732. "type": "object",
  733. "properties": {
  734. "newPassword": {
  735. "type": "string"
  736. },
  737. "password": {
  738. "type": "string"
  739. },
  740. "username": {
  741. "type": "string"
  742. }
  743. }
  744. },
  745. "api.CreateApiParams": {
  746. "type": "object",
  747. "properties": {
  748. "description": {
  749. "type": "string"
  750. },
  751. "path": {
  752. "type": "string"
  753. }
  754. }
  755. },
  756. "api.CreateAuthorityPatams": {
  757. "type": "object",
  758. "properties": {
  759. "authorityId": {
  760. "type": "string"
  761. },
  762. "authorityName": {
  763. "type": "string"
  764. }
  765. }
  766. },
  767. "api.DeleteApiParams": {
  768. "type": "object",
  769. "properties": {
  770. "path": {
  771. "type": "integer"
  772. }
  773. }
  774. },
  775. "api.DeleteAuthorityPatams": {
  776. "type": "object",
  777. "properties": {
  778. "authorityId": {
  779. "type": "integer"
  780. }
  781. }
  782. },
  783. "api.IdInfo": {
  784. "type": "object",
  785. "properties": {
  786. "id": {
  787. "type": "number"
  788. }
  789. }
  790. },
  791. "api.RegistAndLoginStuct": {
  792. "type": "object",
  793. "properties": {
  794. "password": {
  795. "type": "string"
  796. },
  797. "username": {
  798. "type": "string"
  799. }
  800. }
  801. },
  802. "dbModel.Api": {
  803. "type": "object",
  804. "properties": {
  805. "description": {
  806. "type": "string"
  807. },
  808. "path": {
  809. "type": "string"
  810. }
  811. }
  812. },
  813. "dbModel.BaseMenu": {
  814. "type": "object",
  815. "properties": {
  816. "children": {
  817. "type": "array",
  818. "items": {
  819. "$ref": "#/definitions/dbModel.BaseMenu"
  820. }
  821. },
  822. "component": {
  823. "type": "string"
  824. },
  825. "hidden": {
  826. "type": "boolean"
  827. },
  828. "icon": {
  829. "type": "string"
  830. },
  831. "name": {
  832. "type": "string"
  833. },
  834. "nickName": {
  835. "type": "string"
  836. },
  837. "parentId": {
  838. "type": "string"
  839. },
  840. "path": {
  841. "type": "string"
  842. },
  843. "title": {
  844. "type": "string"
  845. }
  846. }
  847. },
  848. "modelInterface.PageInfo": {
  849. "type": "object",
  850. "properties": {
  851. "page": {
  852. "type": "integer"
  853. },
  854. "pageSize": {
  855. "type": "integer"
  856. }
  857. }
  858. }
  859. },
  860. "securityDefinitions": {
  861. "ApiKeyAuth": {
  862. "type": "apiKey",
  863. "name": "x-token",
  864. "in": "header"
  865. }
  866. }
  867. }