swagger.json 52 KB

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