swagger.yaml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  1. basePath: /v1/api
  2. definitions:
  3. admin.AdminPermission:
  4. properties:
  5. created_at:
  6. type: string
  7. created_by:
  8. type: string
  9. description:
  10. type: string
  11. endpoint:
  12. type: string
  13. id:
  14. type: integer
  15. is_reserved:
  16. type: boolean
  17. name:
  18. type: string
  19. roles:
  20. items:
  21. $ref: '#/definitions/base.ListMapItem'
  22. type: array
  23. status:
  24. description: 可以是 "enabled", "disabled", "deleted" 等
  25. type: string
  26. updated_at:
  27. type: string
  28. updated_by:
  29. type: string
  30. type: object
  31. admin.RoleItem:
  32. properties:
  33. created_at:
  34. description: 创建时间
  35. type: string
  36. created_by:
  37. description: 创建人
  38. type: string
  39. description:
  40. description: 描述
  41. type: string
  42. id:
  43. type: integer
  44. is_reserved:
  45. description: 是否可操作
  46. type: boolean
  47. name:
  48. description: 名称
  49. type: string
  50. permissions:
  51. description: 权限
  52. items:
  53. $ref: '#/definitions/base.ListMapItem'
  54. type: array
  55. status:
  56. description: '"enabled", "disabled"'
  57. type: string
  58. updated_at:
  59. description: 更新时间
  60. type: string
  61. users:
  62. description: 关联用户
  63. items:
  64. $ref: '#/definitions/base.ListMapItem'
  65. type: array
  66. type: object
  67. admin.UserItem:
  68. properties:
  69. avatar:
  70. description: 头像
  71. type: string
  72. created_at:
  73. description: 创建时间
  74. type: string
  75. email:
  76. description: 邮箱
  77. type: string
  78. id:
  79. type: integer
  80. is_reserved:
  81. type: boolean
  82. name:
  83. description: 名称
  84. type: string
  85. phone_number:
  86. description: 手机号
  87. type: string
  88. roles:
  89. description: 角色
  90. items:
  91. $ref: '#/definitions/base.ListMapItem'
  92. type: array
  93. status:
  94. allOf:
  95. - $ref: '#/definitions/base.Status'
  96. description: 状态 "enabled"|"disabled"
  97. teams:
  98. description: 团队
  99. items:
  100. $ref: '#/definitions/base.ListMapItem'
  101. type: array
  102. updated_at:
  103. description: 更新时间
  104. type: string
  105. type: object
  106. admin_common.Request:
  107. properties:
  108. password:
  109. description: 密码
  110. maxLength: 18
  111. minLength: 6
  112. type: string
  113. username:
  114. description: 用户名
  115. maxLength: 15
  116. minLength: 5
  117. type: string
  118. required:
  119. - password
  120. - username
  121. type: object
  122. admin_role.CreateAdminRoleRequest:
  123. properties:
  124. description:
  125. description: 非必填,描述
  126. type: string
  127. name:
  128. description: 角色名称
  129. maxLength: 15
  130. minLength: 3
  131. type: string
  132. permissions:
  133. description: 权限
  134. items:
  135. type: integer
  136. type: array
  137. users:
  138. description: 管理员
  139. items:
  140. type: integer
  141. type: array
  142. required:
  143. - name
  144. type: object
  145. admin_role.EnabledRoleItem:
  146. properties:
  147. description:
  148. type: string
  149. id:
  150. type: integer
  151. name:
  152. type: string
  153. type: object
  154. admin_role.EnabledRoles:
  155. properties:
  156. roles:
  157. items:
  158. $ref: '#/definitions/admin_role.EnabledRoleItem'
  159. type: array
  160. type: object
  161. admin_role.ListAdminRolesResponse:
  162. properties:
  163. items:
  164. items:
  165. $ref: '#/definitions/admin.RoleItem'
  166. type: array
  167. total_count:
  168. type: integer
  169. type: object
  170. admin_role.ToggleRequest:
  171. properties:
  172. status:
  173. allOf:
  174. - $ref: '#/definitions/base.Status'
  175. description: '"enabled"|"disabled"'
  176. required:
  177. - status
  178. type: object
  179. admin_role.UpdateRequest:
  180. properties:
  181. description:
  182. description: 非必填,描述
  183. type: string
  184. permissions:
  185. description: 权限
  186. items:
  187. type: integer
  188. type: array
  189. users:
  190. description: 管理员
  191. items:
  192. type: integer
  193. type: array
  194. type: object
  195. admin_user.EnabledUserItem:
  196. properties:
  197. id:
  198. type: integer
  199. name:
  200. type: string
  201. type: object
  202. admin_user.ListAdminUserResponse:
  203. properties:
  204. items:
  205. items:
  206. $ref: '#/definitions/admin.UserItem'
  207. type: array
  208. total_count:
  209. type: integer
  210. type: object
  211. admin_user.ToggleRequest:
  212. properties:
  213. status:
  214. allOf:
  215. - $ref: '#/definitions/base.Status'
  216. description: '"enabled"|"disabled"'
  217. required:
  218. - status
  219. type: object
  220. admin_user.UpdateRequest:
  221. properties:
  222. avatar:
  223. description: 头像
  224. type: string
  225. email:
  226. description: 邮箱
  227. type: string
  228. phone_number:
  229. description: 手机号
  230. type: string
  231. roles:
  232. description: 角色ID
  233. items:
  234. type: integer
  235. type: array
  236. teams:
  237. description: 团队ID
  238. items:
  239. type: integer
  240. type: array
  241. required:
  242. - email
  243. - phone_number
  244. type: object
  245. admin_user.UserRequest:
  246. properties:
  247. avatar:
  248. description: 头像
  249. type: string
  250. email:
  251. description: 邮箱
  252. type: string
  253. password:
  254. description: 密码
  255. maxLength: 18
  256. minLength: 6
  257. type: string
  258. phone_number:
  259. description: 手机号
  260. type: string
  261. roles:
  262. description: 角色ID
  263. items:
  264. type: integer
  265. type: array
  266. teams:
  267. description: 团队ID
  268. items:
  269. type: integer
  270. type: array
  271. username:
  272. description: 用户名
  273. maxLength: 15
  274. minLength: 5
  275. type: string
  276. required:
  277. - password
  278. - phone_number
  279. - username
  280. type: object
  281. authorization_client.AdminUserBase:
  282. properties:
  283. key:
  284. type: string
  285. value:
  286. type: string
  287. type: object
  288. authorization_client.AdminUserProfile:
  289. properties:
  290. address:
  291. type: string
  292. avatar:
  293. type: string
  294. bio:
  295. type: string
  296. birthdate:
  297. type: integer
  298. educations:
  299. items:
  300. $ref: '#/definitions/authorization_client.AdminUserProfileEducation'
  301. type: array
  302. email:
  303. type: string
  304. gender:
  305. type: integer
  306. phone_number:
  307. type: string
  308. social_links:
  309. items:
  310. $ref: '#/definitions/authorization_client.AdminUserProfileSocialLink'
  311. type: array
  312. website:
  313. type: string
  314. work_histories:
  315. items:
  316. $ref: '#/definitions/authorization_client.AdminUserProfileWorkHistory'
  317. type: array
  318. type: object
  319. authorization_client.AdminUserProfileEducation:
  320. properties:
  321. degree:
  322. type: string
  323. graduated:
  324. type: integer
  325. school:
  326. type: string
  327. type: object
  328. authorization_client.AdminUserProfileSocialLink:
  329. properties:
  330. platform:
  331. type: string
  332. url:
  333. type: string
  334. type: object
  335. authorization_client.AdminUserProfileWorkHistory:
  336. properties:
  337. company:
  338. type: string
  339. end_date:
  340. type: integer
  341. position:
  342. type: string
  343. responsibilities:
  344. type: string
  345. start_date:
  346. type: integer
  347. type: object
  348. authorization_client.GetAdminUser:
  349. properties:
  350. profile:
  351. $ref: '#/definitions/authorization_client.AdminUserProfile'
  352. roles:
  353. items:
  354. $ref: '#/definitions/authorization_client.AdminUserBase'
  355. type: array
  356. status:
  357. type: string
  358. teams:
  359. items:
  360. $ref: '#/definitions/authorization_client.AdminUserBase'
  361. type: array
  362. user_id:
  363. type: integer
  364. username:
  365. type: string
  366. type: object
  367. base.ListMapItem:
  368. properties:
  369. key:
  370. type: string
  371. value:
  372. type: string
  373. type: object
  374. base.Status:
  375. enum:
  376. - ENABLED
  377. - DISABLED
  378. - DELETED
  379. type: string
  380. x-enum-varnames:
  381. - ToggleEnabled
  382. - ToggleDisabled
  383. - ToggleDeleted
  384. common.UserInfo:
  385. properties:
  386. avatar:
  387. type: string
  388. email:
  389. type: string
  390. id:
  391. type: integer
  392. phone_number:
  393. type: string
  394. roles:
  395. items:
  396. $ref: '#/definitions/base.ListMapItem'
  397. type: array
  398. teams:
  399. items:
  400. $ref: '#/definitions/base.ListMapItem'
  401. type: array
  402. username:
  403. type: string
  404. type: object
  405. permission.CreateRequest:
  406. properties:
  407. description:
  408. description: 非必填,描述
  409. type: string
  410. endpoint:
  411. type: string
  412. name:
  413. description: 权限名称
  414. maxLength: 50
  415. minLength: 3
  416. type: string
  417. roles:
  418. description: 角色
  419. items:
  420. type: integer
  421. type: array
  422. required:
  423. - endpoint
  424. - name
  425. type: object
  426. permission.ListResponse:
  427. properties:
  428. items:
  429. items:
  430. $ref: '#/definitions/admin.AdminPermission'
  431. type: array
  432. total_count:
  433. type: integer
  434. type: object
  435. permission.ToggleRequest:
  436. properties:
  437. status:
  438. allOf:
  439. - $ref: '#/definitions/base.Status'
  440. description: '"enabled"|"disabled"'
  441. required:
  442. - status
  443. type: object
  444. permission.UpdateRequest:
  445. properties:
  446. description:
  447. description: 非必填,描述
  448. type: string
  449. roles:
  450. description: 角色
  451. items:
  452. type: integer
  453. type: array
  454. type: object
  455. response.ApiResponse:
  456. properties:
  457. code:
  458. type: integer
  459. data: {}
  460. message:
  461. type: string
  462. type: object
  463. externalDocs:
  464. description: OpenAPI
  465. url: https://swagger.io/resources/open-api/
  466. host: localhost:8080
  467. info:
  468. contact:
  469. email: support@swagger.io
  470. name: API Support
  471. url: http://www.swagger.io/support
  472. description: This is a sample server celler server.
  473. license:
  474. name: Apache 2.0
  475. url: http://www.apache.org/licenses/LICENSE-2.0.html
  476. termsOfService: http://swagger.io/terms/
  477. title: Swagger Example API
  478. version: "1.0"
  479. paths:
  480. /v1/api/admin/login:
  481. post:
  482. consumes:
  483. - application/json
  484. description: 登录API
  485. parameters:
  486. - description: 请求body
  487. in: body
  488. name: body
  489. required: true
  490. schema:
  491. $ref: '#/definitions/admin_common.Request'
  492. produces:
  493. - application/json
  494. responses:
  495. "200":
  496. description: 成功
  497. schema:
  498. allOf:
  499. - $ref: '#/definitions/response.ApiResponse'
  500. - properties:
  501. data:
  502. $ref: '#/definitions/common.UserInfo'
  503. type: object
  504. "400":
  505. description: 请求错误
  506. schema:
  507. $ref: '#/definitions/response.ApiResponse'
  508. "500":
  509. description: 内部错误
  510. schema:
  511. $ref: '#/definitions/response.ApiResponse'
  512. summary: 登录
  513. tags:
  514. - Common
  515. /v1/api/admin/permission:
  516. post:
  517. consumes:
  518. - application/json
  519. parameters:
  520. - description: Bearer 用户令牌
  521. in: header
  522. name: Authorization
  523. required: true
  524. type: string
  525. - description: 请求body
  526. in: body
  527. name: body
  528. required: true
  529. schema:
  530. $ref: '#/definitions/permission.CreateRequest'
  531. produces:
  532. - application/json
  533. responses:
  534. "200":
  535. description: 成功
  536. schema:
  537. $ref: '#/definitions/response.ApiResponse'
  538. "400":
  539. description: 请求错误
  540. schema:
  541. $ref: '#/definitions/response.ApiResponse'
  542. "500":
  543. description: 内部错误
  544. schema:
  545. $ref: '#/definitions/response.ApiResponse'
  546. summary: 新增权限
  547. tags:
  548. - Permissions
  549. /v1/api/admin/permission/{permissionID}:
  550. delete:
  551. consumes:
  552. - application/json
  553. parameters:
  554. - description: Bearer 用户令牌
  555. in: header
  556. name: Authorization
  557. required: true
  558. type: string
  559. - description: 权限ID
  560. in: path
  561. name: id
  562. required: true
  563. type: integer
  564. produces:
  565. - application/json
  566. responses:
  567. "200":
  568. description: 成功
  569. schema:
  570. $ref: '#/definitions/response.ApiResponse'
  571. "400":
  572. description: 请求错误
  573. schema:
  574. $ref: '#/definitions/response.ApiResponse'
  575. "500":
  576. description: 内部错误
  577. schema:
  578. $ref: '#/definitions/response.ApiResponse'
  579. summary: 删除权限
  580. tags:
  581. - Permissions
  582. get:
  583. consumes:
  584. - application/json
  585. parameters:
  586. - description: Bearer 用户令牌
  587. in: header
  588. name: Authorization
  589. required: true
  590. type: string
  591. - description: 权限ID
  592. in: path
  593. name: id
  594. required: true
  595. type: integer
  596. produces:
  597. - application/json
  598. responses:
  599. "200":
  600. description: 成功
  601. schema:
  602. allOf:
  603. - $ref: '#/definitions/response.ApiResponse'
  604. - properties:
  605. data:
  606. $ref: '#/definitions/admin.AdminPermission'
  607. type: object
  608. "400":
  609. description: 请求错误
  610. schema:
  611. $ref: '#/definitions/response.ApiResponse'
  612. "500":
  613. description: 内部错误
  614. schema:
  615. $ref: '#/definitions/response.ApiResponse'
  616. summary: 获取权限详情
  617. tags:
  618. - Permissions
  619. put:
  620. consumes:
  621. - application/json
  622. parameters:
  623. - description: Bearer 用户令牌
  624. in: header
  625. name: Authorization
  626. required: true
  627. type: string
  628. - description: 权限ID
  629. in: path
  630. name: id
  631. required: true
  632. type: integer
  633. - description: 请求body
  634. in: body
  635. name: body
  636. required: true
  637. schema:
  638. $ref: '#/definitions/permission.UpdateRequest'
  639. produces:
  640. - application/json
  641. responses:
  642. "200":
  643. description: 成功
  644. schema:
  645. $ref: '#/definitions/response.ApiResponse'
  646. "400":
  647. description: 请求错误
  648. schema:
  649. $ref: '#/definitions/response.ApiResponse'
  650. "500":
  651. description: 内部错误
  652. schema:
  653. $ref: '#/definitions/response.ApiResponse'
  654. summary: 更新权限
  655. tags:
  656. - Permissions
  657. /v1/api/admin/permission/{permissionID}/toggle:
  658. put:
  659. consumes:
  660. - application/json
  661. parameters:
  662. - description: Bearer 用户令牌
  663. in: header
  664. name: Authorization
  665. required: true
  666. type: string
  667. - description: 请求body
  668. in: body
  669. name: body
  670. required: true
  671. schema:
  672. $ref: '#/definitions/permission.ToggleRequest'
  673. produces:
  674. - application/json
  675. responses:
  676. "200":
  677. description: 成功
  678. schema:
  679. $ref: '#/definitions/response.ApiResponse'
  680. "400":
  681. description: 请求错误
  682. schema:
  683. $ref: '#/definitions/response.ApiResponse'
  684. "500":
  685. description: 内部错误
  686. schema:
  687. $ref: '#/definitions/response.ApiResponse'
  688. summary: 启用/禁用
  689. tags:
  690. - Permissions
  691. /v1/api/admin/permissions:
  692. get:
  693. consumes:
  694. - application/json
  695. parameters:
  696. - description: Bearer 用户令牌
  697. in: header
  698. name: Authorization
  699. required: true
  700. type: string
  701. - description: 页码
  702. in: query
  703. name: page
  704. required: true
  705. type: integer
  706. - description: 每页数量
  707. in: query
  708. name: page_size
  709. required: true
  710. type: integer
  711. - description: 关键字
  712. in: query
  713. name: keyword
  714. type: string
  715. - description: 状态
  716. enum:
  717. - enabled
  718. - disabled
  719. in: query
  720. name: status
  721. type: string
  722. produces:
  723. - application/json
  724. responses:
  725. "200":
  726. description: 成功
  727. schema:
  728. allOf:
  729. - $ref: '#/definitions/response.ApiResponse'
  730. - properties:
  731. data:
  732. $ref: '#/definitions/permission.ListResponse'
  733. type: object
  734. "400":
  735. description: 请求错误
  736. schema:
  737. $ref: '#/definitions/response.ApiResponse'
  738. "500":
  739. description: 内部错误
  740. schema:
  741. $ref: '#/definitions/response.ApiResponse'
  742. summary: 权限列表
  743. tags:
  744. - Permissions
  745. /v1/api/admin/profile:
  746. get:
  747. consumes:
  748. - application/json
  749. description: 查询个人信息
  750. parameters:
  751. - description: Bearer 用户令牌
  752. in: header
  753. name: Authorization
  754. required: true
  755. type: string
  756. produces:
  757. - application/json
  758. responses:
  759. "200":
  760. description: 成功
  761. schema:
  762. allOf:
  763. - $ref: '#/definitions/response.ApiResponse'
  764. - properties:
  765. data:
  766. $ref: '#/definitions/common.UserInfo'
  767. type: object
  768. "400":
  769. description: 请求错误
  770. schema:
  771. $ref: '#/definitions/response.ApiResponse'
  772. "500":
  773. description: 内部错误
  774. schema:
  775. $ref: '#/definitions/response.ApiResponse'
  776. summary: 获取个人信息
  777. tags:
  778. - Common
  779. post:
  780. consumes:
  781. - application/json
  782. parameters:
  783. - description: Bearer 用户令牌
  784. in: header
  785. name: Authorization
  786. required: true
  787. type: string
  788. produces:
  789. - application/json
  790. responses:
  791. "200":
  792. description: 成功
  793. schema:
  794. $ref: '#/definitions/response.ApiResponse'
  795. "400":
  796. description: 请求错误
  797. schema:
  798. $ref: '#/definitions/response.ApiResponse'
  799. "500":
  800. description: 内部错误
  801. schema:
  802. $ref: '#/definitions/response.ApiResponse'
  803. summary: 退出登录
  804. tags:
  805. - Common
  806. /v1/api/admin/role:
  807. post:
  808. consumes:
  809. - application/json
  810. description: 创建角色
  811. parameters:
  812. - description: Bearer 用户令牌
  813. in: header
  814. name: Authorization
  815. required: true
  816. type: string
  817. - description: 请求body
  818. in: body
  819. name: body
  820. required: true
  821. schema:
  822. $ref: '#/definitions/admin_role.CreateAdminRoleRequest'
  823. produces:
  824. - application/json
  825. responses:
  826. "200":
  827. description: 成功
  828. schema:
  829. $ref: '#/definitions/response.ApiResponse'
  830. "400":
  831. description: 请求错误
  832. schema:
  833. $ref: '#/definitions/response.ApiResponse'
  834. "500":
  835. description: 内部错误
  836. schema:
  837. $ref: '#/definitions/response.ApiResponse'
  838. summary: 新增角色
  839. tags:
  840. - Role 角色管理
  841. /v1/api/admin/role/{roleID}:
  842. delete:
  843. consumes:
  844. - application/json
  845. description: 删除角色
  846. parameters:
  847. - description: Bearer 用户令牌
  848. in: header
  849. name: Authorization
  850. required: true
  851. type: string
  852. - description: 角色ID
  853. in: path
  854. name: id
  855. required: true
  856. type: integer
  857. produces:
  858. - application/json
  859. responses:
  860. "200":
  861. description: 成功
  862. schema:
  863. $ref: '#/definitions/response.ApiResponse'
  864. "400":
  865. description: 请求错误
  866. schema:
  867. $ref: '#/definitions/response.ApiResponse'
  868. "500":
  869. description: 内部错误
  870. schema:
  871. $ref: '#/definitions/response.ApiResponse'
  872. summary: 删除
  873. tags:
  874. - Role 角色管理
  875. get:
  876. consumes:
  877. - application/json
  878. description: 获取角色详情
  879. parameters:
  880. - description: Bearer 用户令牌
  881. in: header
  882. name: Authorization
  883. required: true
  884. type: string
  885. - description: 角色ID
  886. in: path
  887. name: id
  888. required: true
  889. type: integer
  890. produces:
  891. - application/json
  892. responses:
  893. "200":
  894. description: 成功
  895. schema:
  896. allOf:
  897. - $ref: '#/definitions/response.ApiResponse'
  898. - properties:
  899. data:
  900. $ref: '#/definitions/admin.RoleItem'
  901. type: object
  902. "400":
  903. description: 请求错误
  904. schema:
  905. $ref: '#/definitions/response.ApiResponse'
  906. "500":
  907. description: 内部错误
  908. schema:
  909. $ref: '#/definitions/response.ApiResponse'
  910. summary: 详情
  911. tags:
  912. - Role 角色管理
  913. put:
  914. consumes:
  915. - application/json
  916. description: 更新角色内容
  917. parameters:
  918. - description: Bearer 用户令牌
  919. in: header
  920. name: Authorization
  921. required: true
  922. type: string
  923. - description: 角色ID
  924. in: path
  925. name: id
  926. required: true
  927. type: integer
  928. - description: 请求body
  929. in: body
  930. name: body
  931. required: true
  932. schema:
  933. $ref: '#/definitions/admin_role.UpdateRequest'
  934. produces:
  935. - application/json
  936. responses:
  937. "200":
  938. description: 成功
  939. schema:
  940. $ref: '#/definitions/response.ApiResponse'
  941. "400":
  942. description: 请求错误
  943. schema:
  944. $ref: '#/definitions/response.ApiResponse'
  945. "500":
  946. description: 内部错误
  947. schema:
  948. $ref: '#/definitions/response.ApiResponse'
  949. summary: 更新角色
  950. tags:
  951. - Role 角色管理
  952. /v1/api/admin/role/{roleID}/toggle:
  953. put:
  954. consumes:
  955. - application/json
  956. parameters:
  957. - description: Bearer 用户令牌
  958. in: header
  959. name: Authorization
  960. required: true
  961. type: string
  962. - description: 请求body
  963. in: body
  964. name: body
  965. required: true
  966. schema:
  967. $ref: '#/definitions/admin_role.ToggleRequest'
  968. produces:
  969. - application/json
  970. responses:
  971. "200":
  972. description: 成功
  973. schema:
  974. $ref: '#/definitions/response.ApiResponse'
  975. "400":
  976. description: 请求错误
  977. schema:
  978. $ref: '#/definitions/response.ApiResponse'
  979. "500":
  980. description: 内部错误
  981. schema:
  982. $ref: '#/definitions/response.ApiResponse'
  983. summary: 启用/禁用
  984. tags:
  985. - Role 角色管理
  986. /v1/api/admin/role/labels:
  987. get:
  988. consumes:
  989. - application/json
  990. description: 获取所有已启用角色列表
  991. parameters:
  992. - description: Bearer 用户令牌
  993. in: header
  994. name: Authorization
  995. required: true
  996. type: string
  997. produces:
  998. - application/json
  999. responses:
  1000. "200":
  1001. description: 成功
  1002. schema:
  1003. allOf:
  1004. - $ref: '#/definitions/response.ApiResponse'
  1005. - properties:
  1006. data:
  1007. $ref: '#/definitions/admin_role.EnabledRoles'
  1008. type: object
  1009. "400":
  1010. description: 请求错误
  1011. schema:
  1012. $ref: '#/definitions/response.ApiResponse'
  1013. "500":
  1014. description: 内部错误
  1015. schema:
  1016. $ref: '#/definitions/response.ApiResponse'
  1017. summary: 已启用角色列表
  1018. tags:
  1019. - Role 角色管理
  1020. /v1/api/admin/roles:
  1021. get:
  1022. consumes:
  1023. - application/json
  1024. description: 获取角色列表
  1025. parameters:
  1026. - description: Bearer 用户令牌
  1027. in: header
  1028. name: Authorization
  1029. required: true
  1030. type: string
  1031. - description: 页码
  1032. in: query
  1033. name: page
  1034. required: true
  1035. type: integer
  1036. - description: 每页数量
  1037. in: query
  1038. name: page_size
  1039. required: true
  1040. type: integer
  1041. - description: 关键字
  1042. in: query
  1043. name: keyword
  1044. type: string
  1045. - description: 状态
  1046. enum:
  1047. - enabled
  1048. - disabled
  1049. in: query
  1050. name: status
  1051. type: string
  1052. produces:
  1053. - application/json
  1054. responses:
  1055. "200":
  1056. description: 成功
  1057. schema:
  1058. allOf:
  1059. - $ref: '#/definitions/response.ApiResponse'
  1060. - properties:
  1061. data:
  1062. $ref: '#/definitions/admin_role.ListAdminRolesResponse'
  1063. type: object
  1064. "400":
  1065. description: 请求错误
  1066. schema:
  1067. $ref: '#/definitions/response.ApiResponse'
  1068. "500":
  1069. description: 内部错误
  1070. schema:
  1071. $ref: '#/definitions/response.ApiResponse'
  1072. summary: 角色列表
  1073. tags:
  1074. - Role 角色管理
  1075. /v1/api/admin/user:
  1076. post:
  1077. consumes:
  1078. - application/json
  1079. description: 创建用户
  1080. parameters:
  1081. - description: Bearer 用户令牌
  1082. in: header
  1083. name: Authorization
  1084. required: true
  1085. type: string
  1086. - description: 请求body
  1087. in: body
  1088. name: body
  1089. required: true
  1090. schema:
  1091. $ref: '#/definitions/admin_user.UserRequest'
  1092. produces:
  1093. - application/json
  1094. responses:
  1095. "200":
  1096. description: 成功
  1097. schema:
  1098. $ref: '#/definitions/response.ApiResponse'
  1099. "400":
  1100. description: 请求错误
  1101. schema:
  1102. $ref: '#/definitions/response.ApiResponse'
  1103. "500":
  1104. description: 内部错误
  1105. schema:
  1106. $ref: '#/definitions/response.ApiResponse'
  1107. summary: 新增用户
  1108. tags:
  1109. - User 用户管理
  1110. /v1/api/admin/user/{id}:
  1111. get:
  1112. consumes:
  1113. - application/json
  1114. description: 获取用户详情
  1115. parameters:
  1116. - description: Bearer 用户令牌
  1117. in: header
  1118. name: Authorization
  1119. required: true
  1120. type: string
  1121. - description: 角色ID
  1122. in: path
  1123. name: id
  1124. required: true
  1125. type: integer
  1126. produces:
  1127. - application/json
  1128. responses:
  1129. "200":
  1130. description: 成功
  1131. schema:
  1132. allOf:
  1133. - $ref: '#/definitions/response.ApiResponse'
  1134. - properties:
  1135. data:
  1136. $ref: '#/definitions/authorization_client.GetAdminUser'
  1137. type: object
  1138. "400":
  1139. description: 请求错误
  1140. schema:
  1141. $ref: '#/definitions/response.ApiResponse'
  1142. "500":
  1143. description: 内部错误
  1144. schema:
  1145. $ref: '#/definitions/response.ApiResponse'
  1146. summary: 详情
  1147. tags:
  1148. - User 用户管理
  1149. /v1/api/admin/user/{userID}:
  1150. delete:
  1151. consumes:
  1152. - application/json
  1153. description: 删除管理员
  1154. parameters:
  1155. - description: Bearer 用户令牌
  1156. in: header
  1157. name: Authorization
  1158. required: true
  1159. type: string
  1160. - description: 用户ID
  1161. in: path
  1162. name: id
  1163. required: true
  1164. type: integer
  1165. produces:
  1166. - application/json
  1167. responses:
  1168. "200":
  1169. description: 成功
  1170. schema:
  1171. $ref: '#/definitions/response.ApiResponse'
  1172. "400":
  1173. description: 请求错误
  1174. schema:
  1175. $ref: '#/definitions/response.ApiResponse'
  1176. "500":
  1177. description: 内部错误
  1178. schema:
  1179. $ref: '#/definitions/response.ApiResponse'
  1180. summary: 删除
  1181. tags:
  1182. - User 用户管理
  1183. put:
  1184. consumes:
  1185. - application/json
  1186. description: 更新用户内容
  1187. parameters:
  1188. - description: Bearer 用户令牌
  1189. in: header
  1190. name: Authorization
  1191. required: true
  1192. type: string
  1193. - description: 角色ID
  1194. in: path
  1195. name: id
  1196. required: true
  1197. type: integer
  1198. - description: 请求body
  1199. in: body
  1200. name: body
  1201. required: true
  1202. schema:
  1203. $ref: '#/definitions/admin_user.UpdateRequest'
  1204. produces:
  1205. - application/json
  1206. responses:
  1207. "200":
  1208. description: 成功
  1209. schema:
  1210. $ref: '#/definitions/response.ApiResponse'
  1211. "400":
  1212. description: 请求错误
  1213. schema:
  1214. $ref: '#/definitions/response.ApiResponse'
  1215. "500":
  1216. description: 内部错误
  1217. schema:
  1218. $ref: '#/definitions/response.ApiResponse'
  1219. summary: 修改个人信息
  1220. tags:
  1221. - User 用户管理
  1222. /v1/api/admin/user/{userID}/toggle:
  1223. put:
  1224. consumes:
  1225. - application/json
  1226. parameters:
  1227. - description: Bearer 用户令牌
  1228. in: header
  1229. name: Authorization
  1230. required: true
  1231. type: string
  1232. - description: 请求body
  1233. in: body
  1234. name: body
  1235. required: true
  1236. schema:
  1237. $ref: '#/definitions/admin_user.ToggleRequest'
  1238. produces:
  1239. - application/json
  1240. responses:
  1241. "200":
  1242. description: 成功
  1243. schema:
  1244. $ref: '#/definitions/response.ApiResponse'
  1245. "400":
  1246. description: 请求错误
  1247. schema:
  1248. $ref: '#/definitions/response.ApiResponse'
  1249. "500":
  1250. description: 内部错误
  1251. schema:
  1252. $ref: '#/definitions/response.ApiResponse'
  1253. summary: 启用/禁用
  1254. tags:
  1255. - User 用户管理
  1256. /v1/api/admin/user/labels:
  1257. get:
  1258. consumes:
  1259. - application/json
  1260. description: 获取所有已启用 用户列表
  1261. parameters:
  1262. - description: Bearer 用户令牌
  1263. in: header
  1264. name: Authorization
  1265. required: true
  1266. type: string
  1267. produces:
  1268. - application/json
  1269. responses:
  1270. "200":
  1271. description: 成功
  1272. schema:
  1273. allOf:
  1274. - $ref: '#/definitions/response.ApiResponse'
  1275. - properties:
  1276. data:
  1277. items:
  1278. $ref: '#/definitions/admin_user.EnabledUserItem'
  1279. type: array
  1280. type: object
  1281. "400":
  1282. description: 请求错误
  1283. schema:
  1284. $ref: '#/definitions/response.ApiResponse'
  1285. "500":
  1286. description: 内部错误
  1287. schema:
  1288. $ref: '#/definitions/response.ApiResponse'
  1289. summary: 已启用 用户列表
  1290. tags:
  1291. - User 用户管理
  1292. /v1/api/admin/users:
  1293. get:
  1294. consumes:
  1295. - application/json
  1296. description: 获取用户列表
  1297. parameters:
  1298. - description: Bearer 用户令牌
  1299. in: header
  1300. name: Authorization
  1301. required: true
  1302. type: string
  1303. - description: 页码
  1304. in: query
  1305. name: page
  1306. required: true
  1307. type: integer
  1308. - description: 每页数量
  1309. in: query
  1310. name: page_size
  1311. required: true
  1312. type: integer
  1313. - description: 关键字
  1314. in: query
  1315. name: keyword
  1316. type: string
  1317. - description: 状态
  1318. enum:
  1319. - enabled
  1320. - disabled
  1321. in: query
  1322. name: status
  1323. type: string
  1324. produces:
  1325. - application/json
  1326. responses:
  1327. "200":
  1328. description: 成功
  1329. schema:
  1330. allOf:
  1331. - $ref: '#/definitions/response.ApiResponse'
  1332. - properties:
  1333. data:
  1334. $ref: '#/definitions/admin_user.ListAdminUserResponse'
  1335. type: object
  1336. "400":
  1337. description: 请求错误
  1338. schema:
  1339. $ref: '#/definitions/response.ApiResponse'
  1340. "500":
  1341. description: 内部错误
  1342. schema:
  1343. $ref: '#/definitions/response.ApiResponse'
  1344. summary: 用户列表
  1345. tags:
  1346. - User 用户管理
  1347. securityDefinitions:
  1348. BasicAuth:
  1349. type: basic
  1350. swagger: "2.0"