swagger.json 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "This is a gateway server. On the page, you can go to do testing for every API.",
  5. "title": "Project cp-system-management-gateway's APIs",
  6. "contact": {},
  7. "license": {},
  8. "version": "1.1"
  9. },
  10. "paths": {
  11. "/api/v1/log/list": {
  12. "get": {
  13. "description": "获取日志列表",
  14. "consumes": [
  15. "application/json"
  16. ],
  17. "produces": [
  18. "application/json"
  19. ],
  20. "tags": [
  21. "操作日志"
  22. ],
  23. "summary": "获取日志列表",
  24. "parameters": [
  25. {
  26. "type": "string",
  27. "description": "token",
  28. "name": "token",
  29. "in": "header",
  30. "required": true
  31. },
  32. {
  33. "type": "integer",
  34. "description": " ",
  35. "name": "page",
  36. "in": "query"
  37. },
  38. {
  39. "type": "integer",
  40. "description": " ",
  41. "name": "page_size",
  42. "in": "query"
  43. }
  44. ],
  45. "responses": {
  46. "200": {
  47. "description": "OK",
  48. "schema": {
  49. "$ref": "#/definitions/v1.SystemLogListResponse"
  50. }
  51. },
  52. "500": {
  53. "description": "Internal Server Error",
  54. "schema": {
  55. "$ref": "#/definitions/base.HTTPError"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "/api/v1/organization": {
  62. "put": {
  63. "description": "修改机构",
  64. "consumes": [
  65. "application/json"
  66. ],
  67. "produces": [
  68. "application/json"
  69. ],
  70. "tags": [
  71. "机构"
  72. ],
  73. "summary": "修改机构",
  74. "parameters": [
  75. {
  76. "type": "string",
  77. "description": "token",
  78. "name": "token",
  79. "in": "header",
  80. "required": true
  81. },
  82. {
  83. "description": "机构信息",
  84. "name": "body",
  85. "in": "body",
  86. "required": true,
  87. "schema": {
  88. "$ref": "#/definitions/v1.UpdateOrganizationBody"
  89. }
  90. }
  91. ],
  92. "responses": {
  93. "200": {
  94. "description": "OK",
  95. "schema": {
  96. "$ref": "#/definitions/v1.UpdateOrganizationResponse"
  97. }
  98. },
  99. "500": {
  100. "description": "Internal Server Error",
  101. "schema": {
  102. "$ref": "#/definitions/base.HTTPError"
  103. }
  104. }
  105. }
  106. },
  107. "post": {
  108. "description": "创建机构",
  109. "consumes": [
  110. "application/json"
  111. ],
  112. "produces": [
  113. "application/json"
  114. ],
  115. "tags": [
  116. "机构"
  117. ],
  118. "summary": "创建机构",
  119. "parameters": [
  120. {
  121. "type": "string",
  122. "description": "token",
  123. "name": "token",
  124. "in": "header",
  125. "required": true
  126. },
  127. {
  128. "description": "机构信息",
  129. "name": "body",
  130. "in": "body",
  131. "required": true,
  132. "schema": {
  133. "$ref": "#/definitions/v1.CreateOrganizationBody"
  134. }
  135. }
  136. ],
  137. "responses": {
  138. "200": {
  139. "description": "OK",
  140. "schema": {
  141. "$ref": "#/definitions/v1.CreateOrganizationResponse"
  142. }
  143. },
  144. "500": {
  145. "description": "Internal Server Error",
  146. "schema": {
  147. "$ref": "#/definitions/base.HTTPError"
  148. }
  149. }
  150. }
  151. }
  152. },
  153. "/api/v1/organization/list": {
  154. "get": {
  155. "description": "获取机构列表",
  156. "consumes": [
  157. "application/json"
  158. ],
  159. "produces": [
  160. "application/json"
  161. ],
  162. "tags": [
  163. "机构"
  164. ],
  165. "summary": "获取机构列表",
  166. "parameters": [
  167. {
  168. "type": "string",
  169. "description": "token",
  170. "name": "token",
  171. "in": "header",
  172. "required": true
  173. },
  174. {
  175. "type": "string",
  176. "description": "过滤",
  177. "name": "filter",
  178. "in": "query"
  179. },
  180. {
  181. "type": "integer",
  182. "description": " ",
  183. "name": "page",
  184. "in": "query"
  185. },
  186. {
  187. "type": "integer",
  188. "description": " ",
  189. "name": "page_size",
  190. "in": "query"
  191. }
  192. ],
  193. "responses": {
  194. "200": {
  195. "description": "OK",
  196. "schema": {
  197. "$ref": "#/definitions/v1.OrganizationListResponse"
  198. }
  199. },
  200. "500": {
  201. "description": "Internal Server Error",
  202. "schema": {
  203. "$ref": "#/definitions/base.HTTPError"
  204. }
  205. }
  206. }
  207. }
  208. },
  209. "/api/v1/organization/user": {
  210. "put": {
  211. "description": "修改机构超级管理员",
  212. "consumes": [
  213. "application/json"
  214. ],
  215. "produces": [
  216. "application/json"
  217. ],
  218. "tags": [
  219. "机构"
  220. ],
  221. "summary": "修改机构超级管理员",
  222. "parameters": [
  223. {
  224. "type": "string",
  225. "description": "token",
  226. "name": "token",
  227. "in": "header",
  228. "required": true
  229. },
  230. {
  231. "description": " ",
  232. "name": "body",
  233. "in": "body",
  234. "required": true,
  235. "schema": {
  236. "$ref": "#/definitions/v1.OrganizationUserUpdateBody"
  237. }
  238. }
  239. ],
  240. "responses": {
  241. "200": {
  242. "description": "OK",
  243. "schema": {
  244. "$ref": "#/definitions/v1.OrganizationUserUpdateResponse"
  245. }
  246. },
  247. "500": {
  248. "description": "Internal Server Error",
  249. "schema": {
  250. "$ref": "#/definitions/base.HTTPError"
  251. }
  252. }
  253. }
  254. },
  255. "post": {
  256. "description": "创建机构超级管理员",
  257. "consumes": [
  258. "application/json"
  259. ],
  260. "produces": [
  261. "application/json"
  262. ],
  263. "tags": [
  264. "机构"
  265. ],
  266. "summary": "创建机构超级管理员",
  267. "parameters": [
  268. {
  269. "type": "string",
  270. "description": "token",
  271. "name": "token",
  272. "in": "header",
  273. "required": true
  274. },
  275. {
  276. "description": "机构信息",
  277. "name": "body",
  278. "in": "body",
  279. "required": true,
  280. "schema": {
  281. "$ref": "#/definitions/v1.CreateOrganizationUserBody"
  282. }
  283. }
  284. ],
  285. "responses": {
  286. "200": {
  287. "description": "OK",
  288. "schema": {
  289. "$ref": "#/definitions/v1.CreateOrganizationUserResponse"
  290. }
  291. },
  292. "500": {
  293. "description": "Internal Server Error",
  294. "schema": {
  295. "$ref": "#/definitions/base.HTTPError"
  296. }
  297. }
  298. }
  299. }
  300. },
  301. "/api/v1/organization/user_list": {
  302. "get": {
  303. "description": "获取机构超级管理员列表",
  304. "consumes": [
  305. "application/json"
  306. ],
  307. "produces": [
  308. "application/json"
  309. ],
  310. "tags": [
  311. "机构"
  312. ],
  313. "summary": "获取机构超级管理员列表",
  314. "parameters": [
  315. {
  316. "type": "string",
  317. "description": "token",
  318. "name": "token",
  319. "in": "header",
  320. "required": true
  321. },
  322. {
  323. "type": "integer",
  324. "description": " ",
  325. "name": "page",
  326. "in": "query"
  327. },
  328. {
  329. "type": "integer",
  330. "description": " ",
  331. "name": "page_size",
  332. "in": "query"
  333. },
  334. {
  335. "type": "string",
  336. "description": "机构代码",
  337. "name": "organization_code",
  338. "in": "query",
  339. "required": true
  340. }
  341. ],
  342. "responses": {
  343. "200": {
  344. "description": "OK",
  345. "schema": {
  346. "$ref": "#/definitions/v1.OrganizationUserListResponse"
  347. }
  348. },
  349. "500": {
  350. "description": "Internal Server Error",
  351. "schema": {
  352. "$ref": "#/definitions/base.HTTPError"
  353. }
  354. }
  355. }
  356. }
  357. },
  358. "/api/v1/token_refresh": {
  359. "put": {
  360. "description": "刷新token",
  361. "consumes": [
  362. "application/json"
  363. ],
  364. "produces": [
  365. "application/json"
  366. ],
  367. "tags": [
  368. "用户"
  369. ],
  370. "summary": "刷新token",
  371. "parameters": [
  372. {
  373. "type": "string",
  374. "description": "token",
  375. "name": "token",
  376. "in": "header",
  377. "required": true
  378. }
  379. ],
  380. "responses": {
  381. "200": {
  382. "description": "OK",
  383. "schema": {
  384. "$ref": "#/definitions/v1.TokenResponse"
  385. }
  386. },
  387. "500": {
  388. "description": "Internal Server Error",
  389. "schema": {
  390. "$ref": "#/definitions/base.HTTPError"
  391. }
  392. }
  393. }
  394. }
  395. },
  396. "/api/v1/user/login": {
  397. "post": {
  398. "description": "登录",
  399. "consumes": [
  400. "application/json"
  401. ],
  402. "produces": [
  403. "application/json"
  404. ],
  405. "tags": [
  406. "用户"
  407. ],
  408. "summary": "登录",
  409. "parameters": [
  410. {
  411. "description": "登录信息",
  412. "name": "body",
  413. "in": "body",
  414. "required": true,
  415. "schema": {
  416. "$ref": "#/definitions/v1.LoginBody"
  417. }
  418. }
  419. ],
  420. "responses": {
  421. "200": {
  422. "description": "OK",
  423. "schema": {
  424. "$ref": "#/definitions/v1.LoginResponse"
  425. }
  426. },
  427. "500": {
  428. "description": "Internal Server Error",
  429. "schema": {
  430. "$ref": "#/definitions/base.HTTPError"
  431. }
  432. }
  433. }
  434. }
  435. },
  436. "/api/v1/user/password": {
  437. "put": {
  438. "description": "修改系统账号密码",
  439. "consumes": [
  440. "application/json"
  441. ],
  442. "produces": [
  443. "application/json"
  444. ],
  445. "tags": [
  446. "用户"
  447. ],
  448. "summary": "修改系统账号密码",
  449. "parameters": [
  450. {
  451. "type": "string",
  452. "description": "token",
  453. "name": "token",
  454. "in": "header",
  455. "required": true
  456. },
  457. {
  458. "description": " ",
  459. "name": "body",
  460. "in": "body",
  461. "required": true,
  462. "schema": {
  463. "$ref": "#/definitions/v1.ResetPasswdBody"
  464. }
  465. }
  466. ],
  467. "responses": {
  468. "200": {
  469. "description": "OK",
  470. "schema": {
  471. "$ref": "#/definitions/v1.ResetePasswdResponse"
  472. }
  473. },
  474. "500": {
  475. "description": "Internal Server Error",
  476. "schema": {
  477. "$ref": "#/definitions/base.HTTPError"
  478. }
  479. }
  480. }
  481. }
  482. }
  483. },
  484. "definitions": {
  485. "base.HTTPError": {
  486. "type": "object",
  487. "properties": {
  488. "code": {
  489. "type": "integer",
  490. "format": "int",
  491. "example": 500
  492. },
  493. "message": {
  494. "type": "string",
  495. "example": "status bad request"
  496. }
  497. }
  498. },
  499. "v1.CreateOrganizationBody": {
  500. "type": "object",
  501. "properties": {
  502. "is_disable": {
  503. "type": "boolean"
  504. },
  505. "month": {
  506. "type": "integer"
  507. },
  508. "organization_name": {
  509. "type": "string"
  510. }
  511. }
  512. },
  513. "v1.CreateOrganizationData": {
  514. "type": "object",
  515. "properties": {
  516. "organization_code": {
  517. "type": "string"
  518. }
  519. }
  520. },
  521. "v1.CreateOrganizationResponse": {
  522. "type": "object",
  523. "properties": {
  524. "code": {
  525. "description": "返回码",
  526. "type": "integer",
  527. "format": "int",
  528. "default": 0
  529. },
  530. "data": {
  531. "type": "object",
  532. "$ref": "#/definitions/v1.CreateOrganizationData"
  533. },
  534. "message": {
  535. "description": "消息",
  536. "type": "string",
  537. "default": "success"
  538. }
  539. }
  540. },
  541. "v1.CreateOrganizationUserBody": {
  542. "type": "object",
  543. "properties": {
  544. "email": {
  545. "type": "string"
  546. },
  547. "organization_code": {
  548. "type": "string"
  549. },
  550. "password": {
  551. "type": "string"
  552. },
  553. "phone": {
  554. "type": "string"
  555. },
  556. "username": {
  557. "type": "string"
  558. }
  559. }
  560. },
  561. "v1.CreateOrganizationUserReply": {
  562. "type": "object",
  563. "properties": {
  564. "uid": {
  565. "type": "integer"
  566. }
  567. }
  568. },
  569. "v1.CreateOrganizationUserResponse": {
  570. "type": "object",
  571. "properties": {
  572. "code": {
  573. "description": "返回码",
  574. "type": "integer",
  575. "format": "int",
  576. "default": 0
  577. },
  578. "data": {
  579. "type": "object",
  580. "$ref": "#/definitions/v1.CreateOrganizationUserReply"
  581. },
  582. "message": {
  583. "description": "消息",
  584. "type": "string",
  585. "default": "success"
  586. }
  587. }
  588. },
  589. "v1.LoginBody": {
  590. "type": "object",
  591. "properties": {
  592. "password": {
  593. "type": "string"
  594. },
  595. "user": {
  596. "type": "string"
  597. }
  598. }
  599. },
  600. "v1.LoginData": {
  601. "type": "object",
  602. "properties": {
  603. "token": {
  604. "type": "string"
  605. },
  606. "uid": {
  607. "type": "integer"
  608. },
  609. "user": {
  610. "type": "string"
  611. }
  612. }
  613. },
  614. "v1.LoginResponse": {
  615. "type": "object",
  616. "properties": {
  617. "code": {
  618. "description": "返回码",
  619. "type": "integer",
  620. "format": "int",
  621. "default": 0
  622. },
  623. "data": {
  624. "type": "object",
  625. "$ref": "#/definitions/v1.LoginData"
  626. },
  627. "message": {
  628. "description": "消息",
  629. "type": "string",
  630. "default": "success"
  631. }
  632. }
  633. },
  634. "v1.Organization": {
  635. "type": "object",
  636. "properties": {
  637. "end_time": {
  638. "type": "integer"
  639. },
  640. "is_disable": {
  641. "type": "boolean"
  642. },
  643. "is_expire": {
  644. "type": "boolean"
  645. },
  646. "key": {
  647. "type": "string"
  648. },
  649. "organization_code": {
  650. "type": "string"
  651. },
  652. "organization_name": {
  653. "type": "string"
  654. }
  655. }
  656. },
  657. "v1.OrganizationListReply": {
  658. "type": "object",
  659. "properties": {
  660. "list": {
  661. "type": "array",
  662. "items": {
  663. "$ref": "#/definitions/v1.Organization"
  664. }
  665. },
  666. "page": {
  667. "type": "integer"
  668. },
  669. "total": {
  670. "type": "integer"
  671. }
  672. }
  673. },
  674. "v1.OrganizationListResponse": {
  675. "type": "object",
  676. "properties": {
  677. "code": {
  678. "description": "返回码",
  679. "type": "integer",
  680. "format": "int",
  681. "default": 0
  682. },
  683. "data": {
  684. "type": "object",
  685. "$ref": "#/definitions/v1.OrganizationListReply"
  686. },
  687. "message": {
  688. "description": "消息",
  689. "type": "string",
  690. "default": "success"
  691. }
  692. }
  693. },
  694. "v1.OrganizationUserItem": {
  695. "type": "object",
  696. "properties": {
  697. "created_at": {
  698. "type": "string"
  699. },
  700. "email": {
  701. "type": "string"
  702. },
  703. "id": {
  704. "type": "integer"
  705. },
  706. "organization_code": {
  707. "type": "string"
  708. },
  709. "phone": {
  710. "type": "string"
  711. },
  712. "username": {
  713. "type": "string"
  714. }
  715. }
  716. },
  717. "v1.OrganizationUserListReply": {
  718. "type": "object",
  719. "properties": {
  720. "list": {
  721. "type": "array",
  722. "items": {
  723. "$ref": "#/definitions/v1.OrganizationUserItem"
  724. }
  725. },
  726. "page": {
  727. "type": "integer"
  728. },
  729. "total": {
  730. "type": "integer"
  731. }
  732. }
  733. },
  734. "v1.OrganizationUserListResponse": {
  735. "type": "object",
  736. "properties": {
  737. "code": {
  738. "description": "返回码",
  739. "type": "integer",
  740. "format": "int",
  741. "default": 0
  742. },
  743. "data": {
  744. "type": "object",
  745. "$ref": "#/definitions/v1.OrganizationUserListReply"
  746. },
  747. "message": {
  748. "description": "消息",
  749. "type": "string",
  750. "default": "success"
  751. }
  752. }
  753. },
  754. "v1.OrganizationUserUpdateBody": {
  755. "type": "object",
  756. "properties": {
  757. "email": {
  758. "type": "string"
  759. },
  760. "id": {
  761. "type": "integer"
  762. },
  763. "organization_code": {
  764. "type": "string"
  765. },
  766. "password": {
  767. "type": "string"
  768. },
  769. "phone": {
  770. "type": "string"
  771. },
  772. "username": {
  773. "type": "string"
  774. }
  775. }
  776. },
  777. "v1.OrganizationUserUpdateResponse": {
  778. "type": "object",
  779. "properties": {
  780. "code": {
  781. "description": "返回码",
  782. "type": "integer",
  783. "format": "int",
  784. "default": 0
  785. },
  786. "message": {
  787. "description": "消息",
  788. "type": "string",
  789. "default": "success"
  790. }
  791. }
  792. },
  793. "v1.ResetPasswdBody": {
  794. "type": "object",
  795. "properties": {
  796. "new": {
  797. "type": "string"
  798. },
  799. "old": {
  800. "type": "string"
  801. }
  802. }
  803. },
  804. "v1.ResetePasswdResponse": {
  805. "type": "object",
  806. "properties": {
  807. "code": {
  808. "description": "返回码",
  809. "type": "integer",
  810. "format": "int",
  811. "default": 0
  812. },
  813. "message": {
  814. "description": "消息",
  815. "type": "string",
  816. "default": "success"
  817. }
  818. }
  819. },
  820. "v1.SystemLogItem": {
  821. "type": "object",
  822. "properties": {
  823. "action": {
  824. "description": "行为",
  825. "type": "string"
  826. },
  827. "created_at": {
  828. "description": "时间",
  829. "type": "string"
  830. },
  831. "id": {
  832. "description": "日志id",
  833. "type": "integer"
  834. },
  835. "module": {
  836. "description": "模块",
  837. "type": "string"
  838. },
  839. "origin": {
  840. "description": "修改前信息",
  841. "type": "string"
  842. },
  843. "target": {
  844. "description": "修改后信息",
  845. "type": "string"
  846. },
  847. "uid": {
  848. "description": "账号id",
  849. "type": "integer"
  850. },
  851. "username": {
  852. "description": "账号名",
  853. "type": "string"
  854. }
  855. }
  856. },
  857. "v1.SystemLogListReply": {
  858. "type": "object",
  859. "properties": {
  860. "list": {
  861. "type": "array",
  862. "items": {
  863. "$ref": "#/definitions/v1.SystemLogItem"
  864. }
  865. },
  866. "page": {
  867. "type": "integer"
  868. },
  869. "total": {
  870. "type": "integer"
  871. }
  872. }
  873. },
  874. "v1.SystemLogListResponse": {
  875. "type": "object",
  876. "properties": {
  877. "code": {
  878. "description": "返回码",
  879. "type": "integer",
  880. "format": "int",
  881. "default": 0
  882. },
  883. "data": {
  884. "type": "object",
  885. "$ref": "#/definitions/v1.SystemLogListReply"
  886. },
  887. "message": {
  888. "description": "消息",
  889. "type": "string",
  890. "default": "success"
  891. }
  892. }
  893. },
  894. "v1.TokenResponse": {
  895. "type": "object",
  896. "properties": {
  897. "code": {
  898. "description": "返回码",
  899. "type": "integer",
  900. "format": "int",
  901. "default": 0
  902. },
  903. "data": {
  904. "type": "string"
  905. },
  906. "message": {
  907. "description": "消息",
  908. "type": "string",
  909. "default": "success"
  910. },
  911. "refresh_token": {
  912. "type": "string"
  913. }
  914. }
  915. },
  916. "v1.UpdateOrganizationBody": {
  917. "type": "object",
  918. "properties": {
  919. "is_disable": {
  920. "type": "boolean"
  921. },
  922. "month": {
  923. "type": "integer"
  924. },
  925. "organization_code": {
  926. "type": "string"
  927. },
  928. "organization_name": {
  929. "type": "string"
  930. }
  931. }
  932. },
  933. "v1.UpdateOrganizationResponse": {
  934. "type": "object",
  935. "properties": {
  936. "code": {
  937. "description": "返回码",
  938. "type": "integer",
  939. "format": "int",
  940. "default": 0
  941. },
  942. "message": {
  943. "description": "消息",
  944. "type": "string",
  945. "default": "success"
  946. }
  947. }
  948. }
  949. }
  950. }