docs.go 53 KB

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