swagger.yaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. definitions:
  2. base.HTTPError:
  3. properties:
  4. code:
  5. example: 500
  6. format: int
  7. type: integer
  8. message:
  9. example: status bad request
  10. type: string
  11. type: object
  12. v1.CreateOrganizationBody:
  13. properties:
  14. is_disable:
  15. type: boolean
  16. month:
  17. type: integer
  18. organization_name:
  19. type: string
  20. type: object
  21. v1.CreateOrganizationData:
  22. properties:
  23. organization_code:
  24. type: string
  25. type: object
  26. v1.CreateOrganizationResponse:
  27. properties:
  28. code:
  29. default: 0
  30. description: 返回码
  31. format: int
  32. type: integer
  33. data:
  34. $ref: '#/definitions/v1.CreateOrganizationData'
  35. type: object
  36. message:
  37. default: success
  38. description: 消息
  39. type: string
  40. type: object
  41. v1.CreateOrganizationUserBody:
  42. properties:
  43. email:
  44. type: string
  45. organization_code:
  46. type: string
  47. password:
  48. type: string
  49. phone:
  50. type: string
  51. username:
  52. type: string
  53. type: object
  54. v1.CreateOrganizationUserReply:
  55. properties:
  56. uid:
  57. type: integer
  58. type: object
  59. v1.CreateOrganizationUserResponse:
  60. properties:
  61. code:
  62. default: 0
  63. description: 返回码
  64. format: int
  65. type: integer
  66. data:
  67. $ref: '#/definitions/v1.CreateOrganizationUserReply'
  68. type: object
  69. message:
  70. default: success
  71. description: 消息
  72. type: string
  73. type: object
  74. v1.LoginBody:
  75. properties:
  76. password:
  77. type: string
  78. user:
  79. type: string
  80. type: object
  81. v1.LoginData:
  82. properties:
  83. token:
  84. type: string
  85. uid:
  86. type: integer
  87. user:
  88. type: string
  89. type: object
  90. v1.LoginResponse:
  91. properties:
  92. code:
  93. default: 0
  94. description: 返回码
  95. format: int
  96. type: integer
  97. data:
  98. $ref: '#/definitions/v1.LoginData'
  99. type: object
  100. message:
  101. default: success
  102. description: 消息
  103. type: string
  104. type: object
  105. v1.Organization:
  106. properties:
  107. end_time:
  108. type: integer
  109. is_disable:
  110. type: boolean
  111. is_expire:
  112. type: boolean
  113. key:
  114. type: string
  115. organization_code:
  116. type: string
  117. organization_name:
  118. type: string
  119. type: object
  120. v1.OrganizationListReply:
  121. properties:
  122. list:
  123. items:
  124. $ref: '#/definitions/v1.Organization'
  125. type: array
  126. page:
  127. type: integer
  128. total:
  129. type: integer
  130. type: object
  131. v1.OrganizationListResponse:
  132. properties:
  133. code:
  134. default: 0
  135. description: 返回码
  136. format: int
  137. type: integer
  138. data:
  139. $ref: '#/definitions/v1.OrganizationListReply'
  140. type: object
  141. message:
  142. default: success
  143. description: 消息
  144. type: string
  145. type: object
  146. v1.OrganizationUserItem:
  147. properties:
  148. created_at:
  149. type: string
  150. email:
  151. type: string
  152. id:
  153. type: integer
  154. organization_code:
  155. type: string
  156. phone:
  157. type: string
  158. username:
  159. type: string
  160. type: object
  161. v1.OrganizationUserListReply:
  162. properties:
  163. list:
  164. items:
  165. $ref: '#/definitions/v1.OrganizationUserItem'
  166. type: array
  167. page:
  168. type: integer
  169. total:
  170. type: integer
  171. type: object
  172. v1.OrganizationUserListResponse:
  173. properties:
  174. code:
  175. default: 0
  176. description: 返回码
  177. format: int
  178. type: integer
  179. data:
  180. $ref: '#/definitions/v1.OrganizationUserListReply'
  181. type: object
  182. message:
  183. default: success
  184. description: 消息
  185. type: string
  186. type: object
  187. v1.OrganizationUserUpdateBody:
  188. properties:
  189. email:
  190. type: string
  191. id:
  192. type: integer
  193. organization_code:
  194. type: string
  195. password:
  196. type: string
  197. phone:
  198. type: string
  199. username:
  200. type: string
  201. type: object
  202. v1.OrganizationUserUpdateResponse:
  203. properties:
  204. code:
  205. default: 0
  206. description: 返回码
  207. format: int
  208. type: integer
  209. message:
  210. default: success
  211. description: 消息
  212. type: string
  213. type: object
  214. v1.ResetPasswdBody:
  215. properties:
  216. new:
  217. type: string
  218. old:
  219. type: string
  220. type: object
  221. v1.ResetePasswdResponse:
  222. properties:
  223. code:
  224. default: 0
  225. description: 返回码
  226. format: int
  227. type: integer
  228. message:
  229. default: success
  230. description: 消息
  231. type: string
  232. type: object
  233. v1.SystemLogItem:
  234. properties:
  235. action:
  236. description: 行为
  237. type: string
  238. created_at:
  239. description: 时间
  240. type: string
  241. id:
  242. description: 日志id
  243. type: integer
  244. module:
  245. description: 模块
  246. type: string
  247. origin:
  248. description: 修改前信息
  249. type: string
  250. target:
  251. description: 修改后信息
  252. type: string
  253. uid:
  254. description: 账号id
  255. type: integer
  256. username:
  257. description: 账号名
  258. type: string
  259. type: object
  260. v1.SystemLogListReply:
  261. properties:
  262. list:
  263. items:
  264. $ref: '#/definitions/v1.SystemLogItem'
  265. type: array
  266. page:
  267. type: integer
  268. total:
  269. type: integer
  270. type: object
  271. v1.SystemLogListResponse:
  272. properties:
  273. code:
  274. default: 0
  275. description: 返回码
  276. format: int
  277. type: integer
  278. data:
  279. $ref: '#/definitions/v1.SystemLogListReply'
  280. type: object
  281. message:
  282. default: success
  283. description: 消息
  284. type: string
  285. type: object
  286. v1.TokenResponse:
  287. properties:
  288. code:
  289. default: 0
  290. description: 返回码
  291. format: int
  292. type: integer
  293. data:
  294. type: string
  295. message:
  296. default: success
  297. description: 消息
  298. type: string
  299. refresh_token:
  300. type: string
  301. type: object
  302. v1.UpdateOrganizationBody:
  303. properties:
  304. is_disable:
  305. type: boolean
  306. month:
  307. type: integer
  308. organization_code:
  309. type: string
  310. organization_name:
  311. type: string
  312. type: object
  313. v1.UpdateOrganizationResponse:
  314. properties:
  315. code:
  316. default: 0
  317. description: 返回码
  318. format: int
  319. type: integer
  320. message:
  321. default: success
  322. description: 消息
  323. type: string
  324. type: object
  325. info:
  326. contact: {}
  327. description: This is a gateway server. On the page, you can go to do testing for every API.
  328. license: {}
  329. title: Project cp-system-management-gateway's APIs
  330. version: "1.1"
  331. paths:
  332. /api/v1/log/list:
  333. get:
  334. consumes:
  335. - application/json
  336. description: 获取日志列表
  337. parameters:
  338. - description: token
  339. in: header
  340. name: token
  341. required: true
  342. type: string
  343. - description: ' '
  344. in: query
  345. name: page
  346. type: integer
  347. - description: ' '
  348. in: query
  349. name: page_size
  350. type: integer
  351. produces:
  352. - application/json
  353. responses:
  354. "200":
  355. description: OK
  356. schema:
  357. $ref: '#/definitions/v1.SystemLogListResponse'
  358. "500":
  359. description: Internal Server Error
  360. schema:
  361. $ref: '#/definitions/base.HTTPError'
  362. summary: 获取日志列表
  363. tags:
  364. - 操作日志
  365. /api/v1/organization:
  366. post:
  367. consumes:
  368. - application/json
  369. description: 创建机构
  370. parameters:
  371. - description: token
  372. in: header
  373. name: token
  374. required: true
  375. type: string
  376. - description: 机构信息
  377. in: body
  378. name: body
  379. required: true
  380. schema:
  381. $ref: '#/definitions/v1.CreateOrganizationBody'
  382. produces:
  383. - application/json
  384. responses:
  385. "200":
  386. description: OK
  387. schema:
  388. $ref: '#/definitions/v1.CreateOrganizationResponse'
  389. "500":
  390. description: Internal Server Error
  391. schema:
  392. $ref: '#/definitions/base.HTTPError'
  393. summary: 创建机构
  394. tags:
  395. - 机构
  396. put:
  397. consumes:
  398. - application/json
  399. description: 修改机构
  400. parameters:
  401. - description: token
  402. in: header
  403. name: token
  404. required: true
  405. type: string
  406. - description: 机构信息
  407. in: body
  408. name: body
  409. required: true
  410. schema:
  411. $ref: '#/definitions/v1.UpdateOrganizationBody'
  412. produces:
  413. - application/json
  414. responses:
  415. "200":
  416. description: OK
  417. schema:
  418. $ref: '#/definitions/v1.UpdateOrganizationResponse'
  419. "500":
  420. description: Internal Server Error
  421. schema:
  422. $ref: '#/definitions/base.HTTPError'
  423. summary: 修改机构
  424. tags:
  425. - 机构
  426. /api/v1/organization/list:
  427. get:
  428. consumes:
  429. - application/json
  430. description: 获取机构列表
  431. parameters:
  432. - description: token
  433. in: header
  434. name: token
  435. required: true
  436. type: string
  437. - description: 过滤
  438. in: query
  439. name: filter
  440. type: string
  441. - description: ' '
  442. in: query
  443. name: page
  444. type: integer
  445. - description: ' '
  446. in: query
  447. name: page_size
  448. type: integer
  449. produces:
  450. - application/json
  451. responses:
  452. "200":
  453. description: OK
  454. schema:
  455. $ref: '#/definitions/v1.OrganizationListResponse'
  456. "500":
  457. description: Internal Server Error
  458. schema:
  459. $ref: '#/definitions/base.HTTPError'
  460. summary: 获取机构列表
  461. tags:
  462. - 机构
  463. /api/v1/organization/user:
  464. post:
  465. consumes:
  466. - application/json
  467. description: 创建机构超级管理员
  468. parameters:
  469. - description: token
  470. in: header
  471. name: token
  472. required: true
  473. type: string
  474. - description: 机构信息
  475. in: body
  476. name: body
  477. required: true
  478. schema:
  479. $ref: '#/definitions/v1.CreateOrganizationUserBody'
  480. produces:
  481. - application/json
  482. responses:
  483. "200":
  484. description: OK
  485. schema:
  486. $ref: '#/definitions/v1.CreateOrganizationUserResponse'
  487. "500":
  488. description: Internal Server Error
  489. schema:
  490. $ref: '#/definitions/base.HTTPError'
  491. summary: 创建机构超级管理员
  492. tags:
  493. - 机构
  494. put:
  495. consumes:
  496. - application/json
  497. description: 修改机构超级管理员
  498. parameters:
  499. - description: token
  500. in: header
  501. name: token
  502. required: true
  503. type: string
  504. - description: ' '
  505. in: body
  506. name: body
  507. required: true
  508. schema:
  509. $ref: '#/definitions/v1.OrganizationUserUpdateBody'
  510. produces:
  511. - application/json
  512. responses:
  513. "200":
  514. description: OK
  515. schema:
  516. $ref: '#/definitions/v1.OrganizationUserUpdateResponse'
  517. "500":
  518. description: Internal Server Error
  519. schema:
  520. $ref: '#/definitions/base.HTTPError'
  521. summary: 修改机构超级管理员
  522. tags:
  523. - 机构
  524. /api/v1/organization/user_list:
  525. get:
  526. consumes:
  527. - application/json
  528. description: 获取机构超级管理员列表
  529. parameters:
  530. - description: token
  531. in: header
  532. name: token
  533. required: true
  534. type: string
  535. - description: ' '
  536. in: query
  537. name: page
  538. type: integer
  539. - description: ' '
  540. in: query
  541. name: page_size
  542. type: integer
  543. - description: 机构代码
  544. in: query
  545. name: organization_code
  546. required: true
  547. type: string
  548. produces:
  549. - application/json
  550. responses:
  551. "200":
  552. description: OK
  553. schema:
  554. $ref: '#/definitions/v1.OrganizationUserListResponse'
  555. "500":
  556. description: Internal Server Error
  557. schema:
  558. $ref: '#/definitions/base.HTTPError'
  559. summary: 获取机构超级管理员列表
  560. tags:
  561. - 机构
  562. /api/v1/token_refresh:
  563. put:
  564. consumes:
  565. - application/json
  566. description: 刷新token
  567. parameters:
  568. - description: token
  569. in: header
  570. name: token
  571. required: true
  572. type: string
  573. produces:
  574. - application/json
  575. responses:
  576. "200":
  577. description: OK
  578. schema:
  579. $ref: '#/definitions/v1.TokenResponse'
  580. "500":
  581. description: Internal Server Error
  582. schema:
  583. $ref: '#/definitions/base.HTTPError'
  584. summary: 刷新token
  585. tags:
  586. - 用户
  587. /api/v1/user/login:
  588. post:
  589. consumes:
  590. - application/json
  591. description: 登录
  592. parameters:
  593. - description: 登录信息
  594. in: body
  595. name: body
  596. required: true
  597. schema:
  598. $ref: '#/definitions/v1.LoginBody'
  599. produces:
  600. - application/json
  601. responses:
  602. "200":
  603. description: OK
  604. schema:
  605. $ref: '#/definitions/v1.LoginResponse'
  606. "500":
  607. description: Internal Server Error
  608. schema:
  609. $ref: '#/definitions/base.HTTPError'
  610. summary: 登录
  611. tags:
  612. - 用户
  613. /api/v1/user/password:
  614. put:
  615. consumes:
  616. - application/json
  617. description: 修改系统账号密码
  618. parameters:
  619. - description: token
  620. in: header
  621. name: token
  622. required: true
  623. type: string
  624. - description: ' '
  625. in: body
  626. name: body
  627. required: true
  628. schema:
  629. $ref: '#/definitions/v1.ResetPasswdBody'
  630. produces:
  631. - application/json
  632. responses:
  633. "200":
  634. description: OK
  635. schema:
  636. $ref: '#/definitions/v1.ResetePasswdResponse'
  637. "500":
  638. description: Internal Server Error
  639. schema:
  640. $ref: '#/definitions/base.HTTPError'
  641. summary: 修改系统账号密码
  642. tags:
  643. - 用户
  644. swagger: "2.0"