swagger.yaml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  1. basePath: /v1/api
  2. definitions:
  3. admin.RoleItem:
  4. properties:
  5. created_at:
  6. description: 创建时间
  7. type: string
  8. created_by:
  9. description: 创建人
  10. type: string
  11. description:
  12. description: 描述
  13. type: string
  14. id:
  15. type: integer
  16. is_reserved:
  17. description: 是否可操作
  18. type: boolean
  19. name:
  20. description: 名称
  21. type: string
  22. permissions:
  23. description: 权限
  24. items:
  25. $ref: '#/definitions/base.ListMapItem'
  26. type: array
  27. status:
  28. description: '"enabled", "disabled"'
  29. type: string
  30. updated_at:
  31. description: 更新时间
  32. type: string
  33. users:
  34. description: 关联用户
  35. items:
  36. $ref: '#/definitions/base.ListMapItem'
  37. type: array
  38. type: object
  39. admin.UserItem:
  40. properties:
  41. avatar:
  42. description: 头像
  43. type: string
  44. created_at:
  45. description: 创建时间
  46. type: string
  47. email:
  48. description: 邮箱
  49. type: string
  50. id:
  51. type: integer
  52. is_reserved:
  53. type: boolean
  54. name:
  55. description: 名称
  56. type: string
  57. phone_number:
  58. description: 手机号
  59. type: string
  60. roles:
  61. description: 角色
  62. items:
  63. $ref: '#/definitions/base.ListMapItem'
  64. type: array
  65. status:
  66. allOf:
  67. - $ref: '#/definitions/base.Status'
  68. description: 状态 "enabled"|"disabled"
  69. teams:
  70. description: 团队
  71. items:
  72. $ref: '#/definitions/base.ListMapItem'
  73. type: array
  74. updated_at:
  75. description: 更新时间
  76. type: string
  77. type: object
  78. admin_common.Request:
  79. properties:
  80. password:
  81. description: 密码
  82. maxLength: 18
  83. minLength: 6
  84. type: string
  85. username:
  86. description: 用户名
  87. maxLength: 15
  88. minLength: 5
  89. type: string
  90. required:
  91. - password
  92. - username
  93. type: object
  94. admin_role.CreateAdminRoleRequest:
  95. properties:
  96. description:
  97. description: 非必填,描述
  98. type: string
  99. name:
  100. description: 角色名称
  101. maxLength: 15
  102. minLength: 3
  103. type: string
  104. required:
  105. - name
  106. type: object
  107. admin_role.EnabledRoleItem:
  108. properties:
  109. description:
  110. type: string
  111. id:
  112. type: integer
  113. name:
  114. type: string
  115. type: object
  116. admin_role.EnabledRoles:
  117. properties:
  118. roles:
  119. items:
  120. $ref: '#/definitions/admin_role.EnabledRoleItem'
  121. type: array
  122. type: object
  123. admin_role.ListAdminRolesResponse:
  124. properties:
  125. items:
  126. items:
  127. $ref: '#/definitions/admin.RoleItem'
  128. type: array
  129. total_count:
  130. type: integer
  131. type: object
  132. admin_role.ToggleRequest:
  133. properties:
  134. status:
  135. allOf:
  136. - $ref: '#/definitions/base.Status'
  137. description: '"enabled"|"disabled"'
  138. required:
  139. - status
  140. type: object
  141. admin_role.UpdateRequest:
  142. properties:
  143. description:
  144. description: 非必填,描述
  145. type: string
  146. permissions:
  147. description: 权限
  148. items:
  149. type: integer
  150. type: array
  151. users:
  152. description: 管理员
  153. items:
  154. type: integer
  155. type: array
  156. type: object
  157. admin_user.EnabledUserItem:
  158. properties:
  159. id:
  160. type: integer
  161. name:
  162. type: string
  163. type: object
  164. admin_user.ListAdminUserResponse:
  165. properties:
  166. items:
  167. items:
  168. $ref: '#/definitions/admin.UserItem'
  169. type: array
  170. total_count:
  171. type: integer
  172. type: object
  173. admin_user.ToggleRequest:
  174. properties:
  175. status:
  176. allOf:
  177. - $ref: '#/definitions/base.Status'
  178. description: '"enabled"|"disabled"'
  179. required:
  180. - status
  181. type: object
  182. admin_user.UpdateRequest:
  183. properties:
  184. avatar:
  185. description: 头像
  186. type: string
  187. email:
  188. description: 邮箱
  189. type: string
  190. phone_number:
  191. description: 手机号
  192. type: string
  193. roles:
  194. description: 角色ID
  195. items:
  196. type: integer
  197. type: array
  198. teams:
  199. description: 团队ID
  200. items:
  201. type: integer
  202. type: array
  203. required:
  204. - email
  205. - phone_number
  206. type: object
  207. admin_user.UserRequest:
  208. properties:
  209. avatar:
  210. description: 头像
  211. type: string
  212. email:
  213. description: 邮箱
  214. type: string
  215. password:
  216. description: 密码
  217. maxLength: 18
  218. minLength: 6
  219. type: string
  220. phone_number:
  221. description: 手机号
  222. type: string
  223. roles:
  224. description: 角色ID
  225. items:
  226. type: integer
  227. type: array
  228. teams:
  229. description: 团队ID
  230. items:
  231. type: integer
  232. type: array
  233. username:
  234. description: 用户名
  235. maxLength: 15
  236. minLength: 5
  237. type: string
  238. required:
  239. - password
  240. - phone_number
  241. - username
  242. type: object
  243. authorization_client.AdminUserBase:
  244. properties:
  245. key:
  246. type: string
  247. value:
  248. type: string
  249. type: object
  250. authorization_client.AdminUserProfile:
  251. properties:
  252. address:
  253. type: string
  254. avatar:
  255. type: string
  256. bio:
  257. type: string
  258. birthdate:
  259. type: integer
  260. educations:
  261. items:
  262. $ref: '#/definitions/authorization_client.AdminUserProfileEducation'
  263. type: array
  264. email:
  265. type: string
  266. gender:
  267. type: integer
  268. phone_number:
  269. type: string
  270. social_links:
  271. items:
  272. $ref: '#/definitions/authorization_client.AdminUserProfileSocialLink'
  273. type: array
  274. website:
  275. type: string
  276. work_histories:
  277. items:
  278. $ref: '#/definitions/authorization_client.AdminUserProfileWorkHistory'
  279. type: array
  280. type: object
  281. authorization_client.AdminUserProfileEducation:
  282. properties:
  283. degree:
  284. type: string
  285. graduated:
  286. type: integer
  287. school:
  288. type: string
  289. type: object
  290. authorization_client.AdminUserProfileSocialLink:
  291. properties:
  292. platform:
  293. type: string
  294. url:
  295. type: string
  296. type: object
  297. authorization_client.AdminUserProfileWorkHistory:
  298. properties:
  299. company:
  300. type: string
  301. end_date:
  302. type: integer
  303. position:
  304. type: string
  305. responsibilities:
  306. type: string
  307. start_date:
  308. type: integer
  309. type: object
  310. authorization_client.GetAdminUser:
  311. properties:
  312. profile:
  313. $ref: '#/definitions/authorization_client.AdminUserProfile'
  314. roles:
  315. items:
  316. $ref: '#/definitions/authorization_client.AdminUserBase'
  317. type: array
  318. status:
  319. type: string
  320. teams:
  321. items:
  322. $ref: '#/definitions/authorization_client.AdminUserBase'
  323. type: array
  324. user_id:
  325. type: integer
  326. username:
  327. type: string
  328. type: object
  329. base.ListMapItem:
  330. properties:
  331. key:
  332. type: string
  333. value:
  334. type: string
  335. type: object
  336. base.Status:
  337. enum:
  338. - ENABLED
  339. - DISABLED
  340. - DELETED
  341. type: string
  342. x-enum-varnames:
  343. - ToggleEnabled
  344. - ToggleDisabled
  345. - ToggleDeleted
  346. common.UserInfo:
  347. properties:
  348. avatar:
  349. type: string
  350. email:
  351. type: string
  352. id:
  353. type: integer
  354. phone_number:
  355. type: string
  356. roles:
  357. items:
  358. $ref: '#/definitions/base.ListMapItem'
  359. type: array
  360. teams:
  361. items:
  362. $ref: '#/definitions/base.ListMapItem'
  363. type: array
  364. username:
  365. type: string
  366. type: object
  367. response.ApiResponse:
  368. properties:
  369. code:
  370. type: integer
  371. data: {}
  372. message:
  373. type: string
  374. type: object
  375. externalDocs:
  376. description: OpenAPI
  377. url: https://swagger.io/resources/open-api/
  378. host: localhost:8080
  379. info:
  380. contact:
  381. email: support@swagger.io
  382. name: API Support
  383. url: http://www.swagger.io/support
  384. description: This is a sample server celler server.
  385. license:
  386. name: Apache 2.0
  387. url: http://www.apache.org/licenses/LICENSE-2.0.html
  388. termsOfService: http://swagger.io/terms/
  389. title: Swagger Example API
  390. version: "1.0"
  391. paths:
  392. /v1/api/admin/login:
  393. post:
  394. consumes:
  395. - application/json
  396. description: 登录API
  397. parameters:
  398. - description: 请求body
  399. in: body
  400. name: body
  401. required: true
  402. schema:
  403. $ref: '#/definitions/admin_common.Request'
  404. produces:
  405. - application/json
  406. responses:
  407. "200":
  408. description: 成功
  409. schema:
  410. allOf:
  411. - $ref: '#/definitions/response.ApiResponse'
  412. - properties:
  413. data:
  414. $ref: '#/definitions/common.UserInfo'
  415. type: object
  416. "400":
  417. description: 请求错误
  418. schema:
  419. $ref: '#/definitions/response.ApiResponse'
  420. "500":
  421. description: 内部错误
  422. schema:
  423. $ref: '#/definitions/response.ApiResponse'
  424. summary: 登录
  425. tags:
  426. - Common
  427. /v1/api/admin/profile:
  428. get:
  429. consumes:
  430. - application/json
  431. description: 查询个人信息
  432. parameters:
  433. - description: Bearer 用户令牌
  434. in: header
  435. name: Authorization
  436. required: true
  437. type: string
  438. produces:
  439. - application/json
  440. responses:
  441. "200":
  442. description: 成功
  443. schema:
  444. allOf:
  445. - $ref: '#/definitions/response.ApiResponse'
  446. - properties:
  447. data:
  448. $ref: '#/definitions/common.UserInfo'
  449. type: object
  450. "400":
  451. description: 请求错误
  452. schema:
  453. $ref: '#/definitions/response.ApiResponse'
  454. "500":
  455. description: 内部错误
  456. schema:
  457. $ref: '#/definitions/response.ApiResponse'
  458. summary: 获取个人信息
  459. tags:
  460. - Common
  461. post:
  462. consumes:
  463. - application/json
  464. parameters:
  465. - description: Bearer 用户令牌
  466. in: header
  467. name: Authorization
  468. required: true
  469. type: string
  470. produces:
  471. - application/json
  472. responses:
  473. "200":
  474. description: 成功
  475. schema:
  476. $ref: '#/definitions/response.ApiResponse'
  477. "400":
  478. description: 请求错误
  479. schema:
  480. $ref: '#/definitions/response.ApiResponse'
  481. "500":
  482. description: 内部错误
  483. schema:
  484. $ref: '#/definitions/response.ApiResponse'
  485. summary: 退出登录
  486. tags:
  487. - Common
  488. /v1/api/admin/role:
  489. post:
  490. consumes:
  491. - application/json
  492. description: 创建角色
  493. parameters:
  494. - description: Bearer 用户令牌
  495. in: header
  496. name: Authorization
  497. required: true
  498. type: string
  499. - description: 请求body
  500. in: body
  501. name: body
  502. required: true
  503. schema:
  504. $ref: '#/definitions/admin_role.CreateAdminRoleRequest'
  505. produces:
  506. - application/json
  507. responses:
  508. "200":
  509. description: 成功
  510. schema:
  511. $ref: '#/definitions/response.ApiResponse'
  512. "400":
  513. description: 请求错误
  514. schema:
  515. $ref: '#/definitions/response.ApiResponse'
  516. "500":
  517. description: 内部错误
  518. schema:
  519. $ref: '#/definitions/response.ApiResponse'
  520. summary: 新增角色
  521. tags:
  522. - Role 角色管理
  523. /v1/api/admin/role/{roleID}:
  524. delete:
  525. consumes:
  526. - application/json
  527. description: 删除角色
  528. parameters:
  529. - description: Bearer 用户令牌
  530. in: header
  531. name: Authorization
  532. required: true
  533. type: string
  534. - description: 角色ID
  535. in: path
  536. name: id
  537. required: true
  538. type: integer
  539. produces:
  540. - application/json
  541. responses:
  542. "200":
  543. description: 成功
  544. schema:
  545. $ref: '#/definitions/response.ApiResponse'
  546. "400":
  547. description: 请求错误
  548. schema:
  549. $ref: '#/definitions/response.ApiResponse'
  550. "500":
  551. description: 内部错误
  552. schema:
  553. $ref: '#/definitions/response.ApiResponse'
  554. summary: 删除
  555. tags:
  556. - Role 角色管理
  557. get:
  558. consumes:
  559. - application/json
  560. description: 获取角色详情
  561. parameters:
  562. - description: Bearer 用户令牌
  563. in: header
  564. name: Authorization
  565. required: true
  566. type: string
  567. - description: 角色ID
  568. in: path
  569. name: id
  570. required: true
  571. type: integer
  572. produces:
  573. - application/json
  574. responses:
  575. "200":
  576. description: 成功
  577. schema:
  578. allOf:
  579. - $ref: '#/definitions/response.ApiResponse'
  580. - properties:
  581. data:
  582. $ref: '#/definitions/admin.RoleItem'
  583. type: object
  584. "400":
  585. description: 请求错误
  586. schema:
  587. $ref: '#/definitions/response.ApiResponse'
  588. "500":
  589. description: 内部错误
  590. schema:
  591. $ref: '#/definitions/response.ApiResponse'
  592. summary: 详情
  593. tags:
  594. - Role 角色管理
  595. put:
  596. consumes:
  597. - application/json
  598. description: 更新角色内容
  599. parameters:
  600. - description: Bearer 用户令牌
  601. in: header
  602. name: Authorization
  603. required: true
  604. type: string
  605. - description: 角色ID
  606. in: path
  607. name: id
  608. required: true
  609. type: integer
  610. - description: 请求body
  611. in: body
  612. name: body
  613. required: true
  614. schema:
  615. $ref: '#/definitions/admin_role.UpdateRequest'
  616. produces:
  617. - application/json
  618. responses:
  619. "200":
  620. description: 成功
  621. schema:
  622. $ref: '#/definitions/response.ApiResponse'
  623. "400":
  624. description: 请求错误
  625. schema:
  626. $ref: '#/definitions/response.ApiResponse'
  627. "500":
  628. description: 内部错误
  629. schema:
  630. $ref: '#/definitions/response.ApiResponse'
  631. summary: 更新角色
  632. tags:
  633. - Role 角色管理
  634. /v1/api/admin/role/{roleID}/toggle:
  635. put:
  636. consumes:
  637. - application/json
  638. parameters:
  639. - description: Bearer 用户令牌
  640. in: header
  641. name: Authorization
  642. required: true
  643. type: string
  644. - description: 请求body
  645. in: body
  646. name: body
  647. required: true
  648. schema:
  649. $ref: '#/definitions/admin_role.ToggleRequest'
  650. produces:
  651. - application/json
  652. responses:
  653. "200":
  654. description: 成功
  655. schema:
  656. $ref: '#/definitions/response.ApiResponse'
  657. "400":
  658. description: 请求错误
  659. schema:
  660. $ref: '#/definitions/response.ApiResponse'
  661. "500":
  662. description: 内部错误
  663. schema:
  664. $ref: '#/definitions/response.ApiResponse'
  665. summary: 启用/禁用
  666. tags:
  667. - Role 角色管理
  668. /v1/api/admin/role/labels:
  669. get:
  670. consumes:
  671. - application/json
  672. description: 获取所有已启用角色列表
  673. parameters:
  674. - description: Bearer 用户令牌
  675. in: header
  676. name: Authorization
  677. required: true
  678. type: string
  679. produces:
  680. - application/json
  681. responses:
  682. "200":
  683. description: 成功
  684. schema:
  685. allOf:
  686. - $ref: '#/definitions/response.ApiResponse'
  687. - properties:
  688. data:
  689. $ref: '#/definitions/admin_role.EnabledRoles'
  690. type: object
  691. "400":
  692. description: 请求错误
  693. schema:
  694. $ref: '#/definitions/response.ApiResponse'
  695. "500":
  696. description: 内部错误
  697. schema:
  698. $ref: '#/definitions/response.ApiResponse'
  699. summary: 已启用角色列表
  700. tags:
  701. - Role 角色管理
  702. /v1/api/admin/roles:
  703. get:
  704. consumes:
  705. - application/json
  706. description: 获取角色列表
  707. parameters:
  708. - description: Bearer 用户令牌
  709. in: header
  710. name: Authorization
  711. required: true
  712. type: string
  713. - description: 页码
  714. in: query
  715. name: page
  716. required: true
  717. type: integer
  718. - description: 每页数量
  719. in: query
  720. name: page_size
  721. required: true
  722. type: integer
  723. - description: 关键字
  724. in: query
  725. name: keyword
  726. type: string
  727. - description: 状态
  728. enum:
  729. - enabled
  730. - disabled
  731. in: query
  732. name: status
  733. type: string
  734. produces:
  735. - application/json
  736. responses:
  737. "200":
  738. description: 成功
  739. schema:
  740. allOf:
  741. - $ref: '#/definitions/response.ApiResponse'
  742. - properties:
  743. data:
  744. $ref: '#/definitions/admin_role.ListAdminRolesResponse'
  745. type: object
  746. "400":
  747. description: 请求错误
  748. schema:
  749. $ref: '#/definitions/response.ApiResponse'
  750. "500":
  751. description: 内部错误
  752. schema:
  753. $ref: '#/definitions/response.ApiResponse'
  754. summary: 角色列表
  755. tags:
  756. - Role 角色管理
  757. /v1/api/admin/user:
  758. post:
  759. consumes:
  760. - application/json
  761. description: 创建用户
  762. parameters:
  763. - description: Bearer 用户令牌
  764. in: header
  765. name: Authorization
  766. required: true
  767. type: string
  768. - description: 请求body
  769. in: body
  770. name: body
  771. required: true
  772. schema:
  773. $ref: '#/definitions/admin_user.UserRequest'
  774. produces:
  775. - application/json
  776. responses:
  777. "200":
  778. description: 成功
  779. schema:
  780. $ref: '#/definitions/response.ApiResponse'
  781. "400":
  782. description: 请求错误
  783. schema:
  784. $ref: '#/definitions/response.ApiResponse'
  785. "500":
  786. description: 内部错误
  787. schema:
  788. $ref: '#/definitions/response.ApiResponse'
  789. summary: 新增用户
  790. tags:
  791. - User 用户管理
  792. /v1/api/admin/user/{id}:
  793. get:
  794. consumes:
  795. - application/json
  796. description: 获取用户详情
  797. parameters:
  798. - description: Bearer 用户令牌
  799. in: header
  800. name: Authorization
  801. required: true
  802. type: string
  803. - description: 角色ID
  804. in: path
  805. name: id
  806. required: true
  807. type: integer
  808. produces:
  809. - application/json
  810. responses:
  811. "200":
  812. description: 成功
  813. schema:
  814. allOf:
  815. - $ref: '#/definitions/response.ApiResponse'
  816. - properties:
  817. data:
  818. $ref: '#/definitions/authorization_client.GetAdminUser'
  819. type: object
  820. "400":
  821. description: 请求错误
  822. schema:
  823. $ref: '#/definitions/response.ApiResponse'
  824. "500":
  825. description: 内部错误
  826. schema:
  827. $ref: '#/definitions/response.ApiResponse'
  828. summary: 详情
  829. tags:
  830. - User 用户管理
  831. /v1/api/admin/user/{userID}:
  832. delete:
  833. consumes:
  834. - application/json
  835. description: 删除管理员
  836. parameters:
  837. - description: Bearer 用户令牌
  838. in: header
  839. name: Authorization
  840. required: true
  841. type: string
  842. - description: 用户ID
  843. in: path
  844. name: id
  845. required: true
  846. type: integer
  847. produces:
  848. - application/json
  849. responses:
  850. "200":
  851. description: 成功
  852. schema:
  853. $ref: '#/definitions/response.ApiResponse'
  854. "400":
  855. description: 请求错误
  856. schema:
  857. $ref: '#/definitions/response.ApiResponse'
  858. "500":
  859. description: 内部错误
  860. schema:
  861. $ref: '#/definitions/response.ApiResponse'
  862. summary: 删除
  863. tags:
  864. - User 用户管理
  865. put:
  866. consumes:
  867. - application/json
  868. description: 更新用户内容
  869. parameters:
  870. - description: Bearer 用户令牌
  871. in: header
  872. name: Authorization
  873. required: true
  874. type: string
  875. - description: 角色ID
  876. in: path
  877. name: id
  878. required: true
  879. type: integer
  880. - description: 请求body
  881. in: body
  882. name: body
  883. required: true
  884. schema:
  885. $ref: '#/definitions/admin_user.UpdateRequest'
  886. produces:
  887. - application/json
  888. responses:
  889. "200":
  890. description: 成功
  891. schema:
  892. $ref: '#/definitions/response.ApiResponse'
  893. "400":
  894. description: 请求错误
  895. schema:
  896. $ref: '#/definitions/response.ApiResponse'
  897. "500":
  898. description: 内部错误
  899. schema:
  900. $ref: '#/definitions/response.ApiResponse'
  901. summary: 修改个人信息
  902. tags:
  903. - User 用户管理
  904. /v1/api/admin/user/{userID}/toggle:
  905. put:
  906. consumes:
  907. - application/json
  908. parameters:
  909. - description: Bearer 用户令牌
  910. in: header
  911. name: Authorization
  912. required: true
  913. type: string
  914. - description: 请求body
  915. in: body
  916. name: body
  917. required: true
  918. schema:
  919. $ref: '#/definitions/admin_user.ToggleRequest'
  920. produces:
  921. - application/json
  922. responses:
  923. "200":
  924. description: 成功
  925. schema:
  926. $ref: '#/definitions/response.ApiResponse'
  927. "400":
  928. description: 请求错误
  929. schema:
  930. $ref: '#/definitions/response.ApiResponse'
  931. "500":
  932. description: 内部错误
  933. schema:
  934. $ref: '#/definitions/response.ApiResponse'
  935. summary: 启用/禁用
  936. tags:
  937. - User 用户管理
  938. /v1/api/admin/user/labels:
  939. get:
  940. consumes:
  941. - application/json
  942. description: 获取所有已启用 用户列表
  943. parameters:
  944. - description: Bearer 用户令牌
  945. in: header
  946. name: Authorization
  947. required: true
  948. type: string
  949. produces:
  950. - application/json
  951. responses:
  952. "200":
  953. description: 成功
  954. schema:
  955. allOf:
  956. - $ref: '#/definitions/response.ApiResponse'
  957. - properties:
  958. data:
  959. items:
  960. $ref: '#/definitions/admin_user.EnabledUserItem'
  961. type: array
  962. type: object
  963. "400":
  964. description: 请求错误
  965. schema:
  966. $ref: '#/definitions/response.ApiResponse'
  967. "500":
  968. description: 内部错误
  969. schema:
  970. $ref: '#/definitions/response.ApiResponse'
  971. summary: 已启用 用户列表
  972. tags:
  973. - User 用户管理
  974. /v1/api/admin/users:
  975. get:
  976. consumes:
  977. - application/json
  978. description: 获取用户列表
  979. parameters:
  980. - description: Bearer 用户令牌
  981. in: header
  982. name: Authorization
  983. required: true
  984. type: string
  985. - description: 页码
  986. in: query
  987. name: page
  988. required: true
  989. type: integer
  990. - description: 每页数量
  991. in: query
  992. name: page_size
  993. required: true
  994. type: integer
  995. - description: 关键字
  996. in: query
  997. name: keyword
  998. type: string
  999. - description: 状态
  1000. enum:
  1001. - enabled
  1002. - disabled
  1003. in: query
  1004. name: status
  1005. type: string
  1006. produces:
  1007. - application/json
  1008. responses:
  1009. "200":
  1010. description: 成功
  1011. schema:
  1012. allOf:
  1013. - $ref: '#/definitions/response.ApiResponse'
  1014. - properties:
  1015. data:
  1016. $ref: '#/definitions/admin_user.ListAdminUserResponse'
  1017. type: object
  1018. "400":
  1019. description: 请求错误
  1020. schema:
  1021. $ref: '#/definitions/response.ApiResponse'
  1022. "500":
  1023. description: 内部错误
  1024. schema:
  1025. $ref: '#/definitions/response.ApiResponse'
  1026. summary: 用户列表
  1027. tags:
  1028. - User 用户管理
  1029. securityDefinitions:
  1030. BasicAuth:
  1031. type: basic
  1032. swagger: "2.0"