api_swagger.json 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "接口",
  5. "title": "管理系统API",
  6. "contact": {},
  7. "version": "1.0"
  8. },
  9. "basePath": "/api",
  10. "paths": {
  11. "/": {
  12. "get": {
  13. "description": "首页",
  14. "consumes": [
  15. "application/json"
  16. ],
  17. "produces": [
  18. "application/json"
  19. ],
  20. "tags": [
  21. "首页"
  22. ],
  23. "summary": "首页",
  24. "responses": {
  25. "200": {
  26. "description": "OK",
  27. "schema": {
  28. "$ref": "#/definitions/response.Response"
  29. }
  30. },
  31. "500": {
  32. "description": "Internal Server Error",
  33. "schema": {
  34. "$ref": "#/definitions/response.Response"
  35. }
  36. }
  37. }
  38. }
  39. },
  40. "/ab": {
  41. "get": {
  42. "security": [
  43. {
  44. "BearerAuth": []
  45. }
  46. ],
  47. "description": "地址列表",
  48. "consumes": [
  49. "application/json"
  50. ],
  51. "produces": [
  52. "application/json"
  53. ],
  54. "tags": [
  55. "地址"
  56. ],
  57. "summary": "地址列表",
  58. "responses": {
  59. "200": {
  60. "description": "OK",
  61. "schema": {
  62. "$ref": "#/definitions/response.Response"
  63. }
  64. },
  65. "500": {
  66. "description": "Internal Server Error",
  67. "schema": {
  68. "$ref": "#/definitions/response.ErrorResponse"
  69. }
  70. }
  71. }
  72. },
  73. "post": {
  74. "security": [
  75. {
  76. "BearerAuth": []
  77. }
  78. ],
  79. "description": "地址更新",
  80. "consumes": [
  81. "application/json"
  82. ],
  83. "produces": [
  84. "application/json"
  85. ],
  86. "tags": [
  87. "地址"
  88. ],
  89. "summary": "地址更新",
  90. "parameters": [
  91. {
  92. "description": "地址表单",
  93. "name": "body",
  94. "in": "body",
  95. "required": true,
  96. "schema": {
  97. "$ref": "#/definitions/api.AddressBookForm"
  98. }
  99. }
  100. ],
  101. "responses": {
  102. "200": {
  103. "description": "null",
  104. "schema": {
  105. "type": "string"
  106. }
  107. },
  108. "500": {
  109. "description": "Internal Server Error",
  110. "schema": {
  111. "$ref": "#/definitions/response.ErrorResponse"
  112. }
  113. }
  114. }
  115. }
  116. },
  117. "/ab/peer/add/{guid}": {
  118. "post": {
  119. "security": [
  120. {
  121. "BearerAuth": []
  122. }
  123. ],
  124. "description": "添加地址",
  125. "consumes": [
  126. "application/json"
  127. ],
  128. "produces": [
  129. "application/json"
  130. ],
  131. "tags": [
  132. "地址[Personal]"
  133. ],
  134. "summary": "添加地址",
  135. "parameters": [
  136. {
  137. "type": "string",
  138. "description": "guid",
  139. "name": "guid",
  140. "in": "path",
  141. "required": true
  142. }
  143. ],
  144. "responses": {
  145. "200": {
  146. "description": "OK",
  147. "schema": {
  148. "type": "string"
  149. }
  150. },
  151. "500": {
  152. "description": "Internal Server Error",
  153. "schema": {
  154. "$ref": "#/definitions/response.ErrorResponse"
  155. }
  156. }
  157. }
  158. },
  159. "delete": {
  160. "security": [
  161. {
  162. "BearerAuth": []
  163. }
  164. ],
  165. "description": "删除地址",
  166. "consumes": [
  167. "application/json"
  168. ],
  169. "produces": [
  170. "application/json"
  171. ],
  172. "tags": [
  173. "地址[Personal]"
  174. ],
  175. "summary": "删除地址",
  176. "parameters": [
  177. {
  178. "type": "string",
  179. "description": "guid",
  180. "name": "guid",
  181. "in": "path",
  182. "required": true
  183. }
  184. ],
  185. "responses": {
  186. "200": {
  187. "description": "OK",
  188. "schema": {
  189. "type": "string"
  190. }
  191. },
  192. "500": {
  193. "description": "Internal Server Error",
  194. "schema": {
  195. "$ref": "#/definitions/response.ErrorResponse"
  196. }
  197. }
  198. }
  199. }
  200. },
  201. "/ab/peer/update/{guid}": {
  202. "put": {
  203. "security": [
  204. {
  205. "BearerAuth": []
  206. }
  207. ],
  208. "description": "更新地址",
  209. "consumes": [
  210. "application/json"
  211. ],
  212. "produces": [
  213. "application/json"
  214. ],
  215. "tags": [
  216. "地址[Personal]"
  217. ],
  218. "summary": "更新地址",
  219. "parameters": [
  220. {
  221. "type": "string",
  222. "description": "guid",
  223. "name": "guid",
  224. "in": "path",
  225. "required": true
  226. }
  227. ],
  228. "responses": {
  229. "200": {
  230. "description": "OK",
  231. "schema": {
  232. "type": "string"
  233. }
  234. },
  235. "500": {
  236. "description": "Internal Server Error",
  237. "schema": {
  238. "$ref": "#/definitions/response.ErrorResponse"
  239. }
  240. }
  241. }
  242. }
  243. },
  244. "/ab/peers": {
  245. "post": {
  246. "security": [
  247. {
  248. "BearerAuth": []
  249. }
  250. ],
  251. "description": "地址",
  252. "consumes": [
  253. "application/json"
  254. ],
  255. "produces": [
  256. "application/json"
  257. ],
  258. "tags": [
  259. "地址[Personal]"
  260. ],
  261. "summary": "地址列表",
  262. "parameters": [
  263. {
  264. "type": "integer",
  265. "description": "页码",
  266. "name": "current",
  267. "in": "query"
  268. },
  269. {
  270. "type": "integer",
  271. "description": "每页数量",
  272. "name": "pageSize",
  273. "in": "query"
  274. },
  275. {
  276. "type": "string",
  277. "description": "guid",
  278. "name": "ab",
  279. "in": "query"
  280. }
  281. ],
  282. "responses": {
  283. "200": {
  284. "description": "OK",
  285. "schema": {
  286. "$ref": "#/definitions/response.Response"
  287. }
  288. },
  289. "500": {
  290. "description": "Internal Server Error",
  291. "schema": {
  292. "$ref": "#/definitions/response.Response"
  293. }
  294. }
  295. }
  296. }
  297. },
  298. "/ab/personal": {
  299. "post": {
  300. "security": [
  301. {
  302. "BearerAuth": []
  303. }
  304. ],
  305. "description": "个人地址",
  306. "consumes": [
  307. "application/json"
  308. ],
  309. "produces": [
  310. "application/json"
  311. ],
  312. "tags": [
  313. "地址[Personal]"
  314. ],
  315. "summary": "个人地址",
  316. "parameters": [
  317. {
  318. "description": "string valid",
  319. "name": "string",
  320. "in": "body",
  321. "schema": {
  322. "type": "string"
  323. }
  324. }
  325. ],
  326. "responses": {
  327. "200": {
  328. "description": "OK",
  329. "schema": {
  330. "$ref": "#/definitions/response.Response"
  331. }
  332. },
  333. "500": {
  334. "description": "Internal Server Error",
  335. "schema": {
  336. "$ref": "#/definitions/response.Response"
  337. }
  338. }
  339. }
  340. }
  341. },
  342. "/ab/settings": {
  343. "post": {
  344. "security": [
  345. {
  346. "BearerAuth": []
  347. }
  348. ],
  349. "description": "设置",
  350. "consumes": [
  351. "application/json"
  352. ],
  353. "produces": [
  354. "application/json"
  355. ],
  356. "tags": [
  357. "地址[Personal]"
  358. ],
  359. "summary": "设置",
  360. "parameters": [
  361. {
  362. "description": "string valid",
  363. "name": "string",
  364. "in": "body",
  365. "schema": {
  366. "type": "string"
  367. }
  368. }
  369. ],
  370. "responses": {
  371. "200": {
  372. "description": "OK",
  373. "schema": {
  374. "$ref": "#/definitions/response.Response"
  375. }
  376. },
  377. "500": {
  378. "description": "Internal Server Error",
  379. "schema": {
  380. "$ref": "#/definitions/response.Response"
  381. }
  382. }
  383. }
  384. }
  385. },
  386. "/ab/shared/profiles": {
  387. "post": {
  388. "security": [
  389. {
  390. "BearerAuth": []
  391. }
  392. ],
  393. "description": "共享",
  394. "consumes": [
  395. "application/json"
  396. ],
  397. "produces": [
  398. "application/json"
  399. ],
  400. "tags": [
  401. "地址[Personal]"
  402. ],
  403. "summary": "共享地址簿",
  404. "parameters": [
  405. {
  406. "type": "integer",
  407. "description": "页码",
  408. "name": "current",
  409. "in": "query"
  410. },
  411. {
  412. "type": "integer",
  413. "description": "每页数量",
  414. "name": "pageSize",
  415. "in": "query"
  416. }
  417. ],
  418. "responses": {
  419. "200": {
  420. "description": "OK",
  421. "schema": {
  422. "$ref": "#/definitions/response.Response"
  423. }
  424. },
  425. "500": {
  426. "description": "Internal Server Error",
  427. "schema": {
  428. "$ref": "#/definitions/response.Response"
  429. }
  430. }
  431. }
  432. }
  433. },
  434. "/ab/tag/add/{guid}": {
  435. "post": {
  436. "security": [
  437. {
  438. "BearerAuth": []
  439. }
  440. ],
  441. "description": "标签",
  442. "consumes": [
  443. "application/json"
  444. ],
  445. "produces": [
  446. "application/json"
  447. ],
  448. "tags": [
  449. "地址[Personal]"
  450. ],
  451. "summary": "标签添加",
  452. "parameters": [
  453. {
  454. "type": "string",
  455. "description": "guid",
  456. "name": "guid",
  457. "in": "path",
  458. "required": true
  459. }
  460. ],
  461. "responses": {
  462. "200": {
  463. "description": "OK",
  464. "schema": {
  465. "type": "string"
  466. }
  467. },
  468. "500": {
  469. "description": "Internal Server Error",
  470. "schema": {
  471. "$ref": "#/definitions/response.ErrorResponse"
  472. }
  473. }
  474. }
  475. }
  476. },
  477. "/ab/tag/rename/{guid}": {
  478. "put": {
  479. "security": [
  480. {
  481. "BearerAuth": []
  482. }
  483. ],
  484. "description": "标签",
  485. "consumes": [
  486. "application/json"
  487. ],
  488. "produces": [
  489. "application/json"
  490. ],
  491. "tags": [
  492. "地址[Personal]"
  493. ],
  494. "summary": "标签重命名",
  495. "parameters": [
  496. {
  497. "type": "string",
  498. "description": "guid",
  499. "name": "guid",
  500. "in": "path",
  501. "required": true
  502. }
  503. ],
  504. "responses": {
  505. "200": {
  506. "description": "OK",
  507. "schema": {
  508. "type": "string"
  509. }
  510. },
  511. "500": {
  512. "description": "Internal Server Error",
  513. "schema": {
  514. "$ref": "#/definitions/response.ErrorResponse"
  515. }
  516. }
  517. }
  518. }
  519. },
  520. "/ab/tag/update/{guid}": {
  521. "put": {
  522. "security": [
  523. {
  524. "BearerAuth": []
  525. }
  526. ],
  527. "description": "标签",
  528. "consumes": [
  529. "application/json"
  530. ],
  531. "produces": [
  532. "application/json"
  533. ],
  534. "tags": [
  535. "地址[Personal]"
  536. ],
  537. "summary": "标签修改颜色",
  538. "parameters": [
  539. {
  540. "type": "string",
  541. "description": "guid",
  542. "name": "guid",
  543. "in": "path",
  544. "required": true
  545. }
  546. ],
  547. "responses": {
  548. "200": {
  549. "description": "OK",
  550. "schema": {
  551. "type": "string"
  552. }
  553. },
  554. "500": {
  555. "description": "Internal Server Error",
  556. "schema": {
  557. "$ref": "#/definitions/response.ErrorResponse"
  558. }
  559. }
  560. }
  561. }
  562. },
  563. "/ab/tag/{guid}": {
  564. "delete": {
  565. "security": [
  566. {
  567. "BearerAuth": []
  568. }
  569. ],
  570. "description": "标签",
  571. "consumes": [
  572. "application/json"
  573. ],
  574. "produces": [
  575. "application/json"
  576. ],
  577. "tags": [
  578. "地址[Personal]"
  579. ],
  580. "summary": "标签删除",
  581. "parameters": [
  582. {
  583. "type": "string",
  584. "description": "guid",
  585. "name": "guid",
  586. "in": "path",
  587. "required": true
  588. }
  589. ],
  590. "responses": {
  591. "200": {
  592. "description": "OK",
  593. "schema": {
  594. "type": "string"
  595. }
  596. },
  597. "500": {
  598. "description": "Internal Server Error",
  599. "schema": {
  600. "$ref": "#/definitions/response.ErrorResponse"
  601. }
  602. }
  603. }
  604. }
  605. },
  606. "/ab/tags/{guid}": {
  607. "post": {
  608. "security": [
  609. {
  610. "BearerAuth": []
  611. }
  612. ],
  613. "description": "标签",
  614. "consumes": [
  615. "application/json"
  616. ],
  617. "produces": [
  618. "application/json"
  619. ],
  620. "tags": [
  621. "地址[Personal]"
  622. ],
  623. "summary": "标签",
  624. "parameters": [
  625. {
  626. "type": "string",
  627. "description": "guid",
  628. "name": "guid",
  629. "in": "path",
  630. "required": true
  631. }
  632. ],
  633. "responses": {
  634. "200": {
  635. "description": "OK",
  636. "schema": {
  637. "$ref": "#/definitions/model.TagList"
  638. }
  639. },
  640. "500": {
  641. "description": "Internal Server Error",
  642. "schema": {
  643. "$ref": "#/definitions/response.ErrorResponse"
  644. }
  645. }
  646. }
  647. }
  648. },
  649. "/api": {
  650. "get": {
  651. "security": [
  652. {
  653. "token": []
  654. }
  655. ],
  656. "description": "用户信息",
  657. "consumes": [
  658. "application/json"
  659. ],
  660. "produces": [
  661. "application/json"
  662. ],
  663. "tags": [
  664. "用户"
  665. ],
  666. "summary": "用户信息",
  667. "responses": {
  668. "200": {
  669. "description": "OK",
  670. "schema": {
  671. "$ref": "#/definitions/api.UserPayload"
  672. }
  673. },
  674. "500": {
  675. "description": "Internal Server Error",
  676. "schema": {
  677. "$ref": "#/definitions/response.Response"
  678. }
  679. }
  680. }
  681. }
  682. },
  683. "/audit/conn": {
  684. "post": {
  685. "description": "审计连接",
  686. "consumes": [
  687. "application/json"
  688. ],
  689. "produces": [
  690. "application/json"
  691. ],
  692. "tags": [
  693. "审计"
  694. ],
  695. "summary": "审计连接",
  696. "parameters": [
  697. {
  698. "description": "审计连接",
  699. "name": "body",
  700. "in": "body",
  701. "required": true,
  702. "schema": {
  703. "$ref": "#/definitions/api.AuditConnForm"
  704. }
  705. }
  706. ],
  707. "responses": {
  708. "200": {
  709. "description": "OK",
  710. "schema": {
  711. "type": "string"
  712. }
  713. },
  714. "500": {
  715. "description": "Internal Server Error",
  716. "schema": {
  717. "$ref": "#/definitions/response.Response"
  718. }
  719. }
  720. }
  721. }
  722. },
  723. "/heartbeat": {
  724. "post": {
  725. "description": "心跳",
  726. "consumes": [
  727. "application/json"
  728. ],
  729. "produces": [
  730. "application/json"
  731. ],
  732. "tags": [
  733. "首页"
  734. ],
  735. "summary": "心跳",
  736. "responses": {
  737. "200": {
  738. "description": "OK"
  739. },
  740. "500": {
  741. "description": "Internal Server Error",
  742. "schema": {
  743. "$ref": "#/definitions/response.Response"
  744. }
  745. }
  746. }
  747. }
  748. },
  749. "/login": {
  750. "post": {
  751. "description": "登录",
  752. "consumes": [
  753. "application/json"
  754. ],
  755. "produces": [
  756. "application/json"
  757. ],
  758. "tags": [
  759. "登录"
  760. ],
  761. "summary": "登录",
  762. "parameters": [
  763. {
  764. "description": "登录表单",
  765. "name": "body",
  766. "in": "body",
  767. "required": true,
  768. "schema": {
  769. "$ref": "#/definitions/api.LoginForm"
  770. }
  771. }
  772. ],
  773. "responses": {
  774. "200": {
  775. "description": "OK",
  776. "schema": {
  777. "$ref": "#/definitions/api.LoginRes"
  778. }
  779. },
  780. "500": {
  781. "description": "Internal Server Error",
  782. "schema": {
  783. "$ref": "#/definitions/response.ErrorResponse"
  784. }
  785. }
  786. }
  787. }
  788. },
  789. "/login-options": {
  790. "post": {
  791. "description": "登录选项",
  792. "consumes": [
  793. "application/json"
  794. ],
  795. "produces": [
  796. "application/json"
  797. ],
  798. "tags": [
  799. "登录"
  800. ],
  801. "summary": "登录选项",
  802. "responses": {
  803. "200": {
  804. "description": "OK",
  805. "schema": {
  806. "type": "array",
  807. "items": {
  808. "type": "string"
  809. }
  810. }
  811. },
  812. "500": {
  813. "description": "Internal Server Error",
  814. "schema": {
  815. "$ref": "#/definitions/response.ErrorResponse"
  816. }
  817. }
  818. }
  819. }
  820. },
  821. "/logout": {
  822. "post": {
  823. "description": "登出",
  824. "consumes": [
  825. "application/json"
  826. ],
  827. "produces": [
  828. "application/json"
  829. ],
  830. "tags": [
  831. "登录"
  832. ],
  833. "summary": "登出",
  834. "responses": {
  835. "200": {
  836. "description": "OK",
  837. "schema": {
  838. "type": "string"
  839. }
  840. },
  841. "500": {
  842. "description": "Internal Server Error",
  843. "schema": {
  844. "$ref": "#/definitions/response.ErrorResponse"
  845. }
  846. }
  847. }
  848. }
  849. },
  850. "/oauth/callback": {
  851. "get": {
  852. "description": "OauthCallback",
  853. "consumes": [
  854. "application/json"
  855. ],
  856. "produces": [
  857. "application/json"
  858. ],
  859. "tags": [
  860. "Oauth"
  861. ],
  862. "summary": "OauthCallback",
  863. "responses": {
  864. "200": {
  865. "description": "OK",
  866. "schema": {
  867. "$ref": "#/definitions/api.LoginRes"
  868. }
  869. },
  870. "500": {
  871. "description": "Internal Server Error",
  872. "schema": {
  873. "$ref": "#/definitions/response.ErrorResponse"
  874. }
  875. }
  876. }
  877. }
  878. },
  879. "/oidc/auth": {
  880. "post": {
  881. "description": "OidcAuth",
  882. "consumes": [
  883. "application/json"
  884. ],
  885. "produces": [
  886. "application/json"
  887. ],
  888. "tags": [
  889. "Oauth"
  890. ],
  891. "summary": "OidcAuth",
  892. "responses": {
  893. "200": {
  894. "description": "OK",
  895. "schema": {
  896. "$ref": "#/definitions/api.LoginRes"
  897. }
  898. },
  899. "500": {
  900. "description": "Internal Server Error",
  901. "schema": {
  902. "$ref": "#/definitions/response.ErrorResponse"
  903. }
  904. }
  905. }
  906. }
  907. },
  908. "/oidc/auth-query": {
  909. "get": {
  910. "description": "OidcAuthQuery",
  911. "consumes": [
  912. "application/json"
  913. ],
  914. "produces": [
  915. "application/json"
  916. ],
  917. "tags": [
  918. "Oauth"
  919. ],
  920. "summary": "OidcAuthQuery",
  921. "responses": {
  922. "200": {
  923. "description": "OK",
  924. "schema": {
  925. "$ref": "#/definitions/api.LoginRes"
  926. }
  927. },
  928. "500": {
  929. "description": "Internal Server Error",
  930. "schema": {
  931. "$ref": "#/definitions/response.ErrorResponse"
  932. }
  933. }
  934. }
  935. }
  936. },
  937. "/peers": {
  938. "get": {
  939. "security": [
  940. {
  941. "BearerAuth": []
  942. }
  943. ],
  944. "description": "机器",
  945. "consumes": [
  946. "application/json"
  947. ],
  948. "produces": [
  949. "application/json"
  950. ],
  951. "tags": [
  952. "群组"
  953. ],
  954. "summary": "机器",
  955. "parameters": [
  956. {
  957. "type": "integer",
  958. "description": "页码",
  959. "name": "page",
  960. "in": "query"
  961. },
  962. {
  963. "type": "integer",
  964. "description": "每页数量",
  965. "name": "pageSize",
  966. "in": "query"
  967. },
  968. {
  969. "type": "integer",
  970. "description": "状态",
  971. "name": "status",
  972. "in": "query"
  973. },
  974. {
  975. "type": "string",
  976. "description": "accessible",
  977. "name": "accessible",
  978. "in": "query"
  979. }
  980. ],
  981. "responses": {
  982. "200": {
  983. "description": "OK",
  984. "schema": {
  985. "$ref": "#/definitions/response.DataResponse"
  986. }
  987. },
  988. "500": {
  989. "description": "Internal Server Error",
  990. "schema": {
  991. "$ref": "#/definitions/response.Response"
  992. }
  993. }
  994. }
  995. }
  996. },
  997. "/server-config": {
  998. "get": {
  999. "security": [
  1000. {
  1001. "token": []
  1002. }
  1003. ],
  1004. "description": "服务配置,给webclient提供api-server",
  1005. "consumes": [
  1006. "application/json"
  1007. ],
  1008. "produces": [
  1009. "application/json"
  1010. ],
  1011. "tags": [
  1012. "WEBCLIENT"
  1013. ],
  1014. "summary": "服务配置",
  1015. "responses": {
  1016. "200": {
  1017. "description": "OK",
  1018. "schema": {
  1019. "$ref": "#/definitions/response.Response"
  1020. }
  1021. },
  1022. "500": {
  1023. "description": "Internal Server Error",
  1024. "schema": {
  1025. "$ref": "#/definitions/response.Response"
  1026. }
  1027. }
  1028. }
  1029. }
  1030. },
  1031. "/shared-peer": {
  1032. "post": {
  1033. "description": "分享的peer",
  1034. "consumes": [
  1035. "application/json"
  1036. ],
  1037. "produces": [
  1038. "application/json"
  1039. ],
  1040. "tags": [
  1041. "WEBCLIENT"
  1042. ],
  1043. "summary": "分享的peer",
  1044. "responses": {
  1045. "200": {
  1046. "description": "OK",
  1047. "schema": {
  1048. "$ref": "#/definitions/response.Response"
  1049. }
  1050. },
  1051. "500": {
  1052. "description": "Internal Server Error",
  1053. "schema": {
  1054. "$ref": "#/definitions/response.Response"
  1055. }
  1056. }
  1057. }
  1058. }
  1059. },
  1060. "/sysinfo": {
  1061. "post": {
  1062. "description": "提交系统信息",
  1063. "consumes": [
  1064. "application/json"
  1065. ],
  1066. "produces": [
  1067. "application/json"
  1068. ],
  1069. "tags": [
  1070. "地址"
  1071. ],
  1072. "summary": "提交系统信息",
  1073. "parameters": [
  1074. {
  1075. "description": "系统信息表单",
  1076. "name": "body",
  1077. "in": "body",
  1078. "required": true,
  1079. "schema": {
  1080. "$ref": "#/definitions/api.PeerForm"
  1081. }
  1082. }
  1083. ],
  1084. "responses": {
  1085. "200": {
  1086. "description": "SYSINFO_UPDATED,ID_NOT_FOUND",
  1087. "schema": {
  1088. "type": "string"
  1089. }
  1090. },
  1091. "500": {
  1092. "description": "Internal Server Error",
  1093. "schema": {
  1094. "$ref": "#/definitions/response.ErrorResponse"
  1095. }
  1096. }
  1097. }
  1098. }
  1099. },
  1100. "/tags": {
  1101. "post": {
  1102. "security": [
  1103. {
  1104. "BearerAuth": []
  1105. }
  1106. ],
  1107. "description": "标签",
  1108. "consumes": [
  1109. "application/json"
  1110. ],
  1111. "produces": [
  1112. "application/json"
  1113. ],
  1114. "tags": [
  1115. "地址"
  1116. ],
  1117. "summary": "标签",
  1118. "responses": {
  1119. "200": {
  1120. "description": "OK",
  1121. "schema": {
  1122. "type": "array",
  1123. "items": {
  1124. "$ref": "#/definitions/model.Tag"
  1125. }
  1126. }
  1127. },
  1128. "500": {
  1129. "description": "Internal Server Error",
  1130. "schema": {
  1131. "$ref": "#/definitions/response.ErrorResponse"
  1132. }
  1133. }
  1134. }
  1135. }
  1136. },
  1137. "/users": {
  1138. "get": {
  1139. "security": [
  1140. {
  1141. "BearerAuth": []
  1142. }
  1143. ],
  1144. "description": "用户列表",
  1145. "consumes": [
  1146. "application/json"
  1147. ],
  1148. "produces": [
  1149. "application/json"
  1150. ],
  1151. "tags": [
  1152. "群组"
  1153. ],
  1154. "summary": "用户列表",
  1155. "parameters": [
  1156. {
  1157. "type": "integer",
  1158. "description": "页码",
  1159. "name": "page",
  1160. "in": "query"
  1161. },
  1162. {
  1163. "type": "integer",
  1164. "description": "每页数量",
  1165. "name": "pageSize",
  1166. "in": "query"
  1167. },
  1168. {
  1169. "type": "integer",
  1170. "description": "状态",
  1171. "name": "status",
  1172. "in": "query"
  1173. },
  1174. {
  1175. "type": "string",
  1176. "description": "accessible",
  1177. "name": "accessible",
  1178. "in": "query"
  1179. }
  1180. ],
  1181. "responses": {
  1182. "200": {
  1183. "description": "OK",
  1184. "schema": {
  1185. "allOf": [
  1186. {
  1187. "$ref": "#/definitions/response.DataResponse"
  1188. },
  1189. {
  1190. "type": "object",
  1191. "properties": {
  1192. "data": {
  1193. "type": "array",
  1194. "items": {
  1195. "$ref": "#/definitions/api.UserPayload"
  1196. }
  1197. }
  1198. }
  1199. }
  1200. ]
  1201. }
  1202. },
  1203. "500": {
  1204. "description": "Internal Server Error",
  1205. "schema": {
  1206. "$ref": "#/definitions/response.ErrorResponse"
  1207. }
  1208. }
  1209. }
  1210. }
  1211. }
  1212. },
  1213. "definitions": {
  1214. "api.AddressBookForm": {
  1215. "type": "object",
  1216. "properties": {
  1217. "data": {
  1218. "type": "string",
  1219. "example": "{\"tags\":[\"tag1\",\"tag2\",\"tag3\"],\"peers\":[{\"id\":\"abc\",\"username\":\"abv-l\",\"hostname\":\"\",\"platform\":\"Windows\",\"alias\":\"\",\"tags\":[\"tag1\",\"tag2\"],\"hash\":\"hash\"}],\"tag_colors\":\"{\\\"tag1\\\":4288585374,\\\"tag2\\\":4278238420,\\\"tag3\\\":4291681337}\"}"
  1220. }
  1221. }
  1222. },
  1223. "api.AuditConnForm": {
  1224. "type": "object",
  1225. "properties": {
  1226. "action": {
  1227. "type": "string"
  1228. },
  1229. "conn_id": {
  1230. "type": "integer"
  1231. },
  1232. "id": {
  1233. "type": "string"
  1234. },
  1235. "ip": {
  1236. "type": "string"
  1237. },
  1238. "peer": {
  1239. "type": "array",
  1240. "items": {
  1241. "type": "string"
  1242. }
  1243. },
  1244. "session_id": {
  1245. "type": "number"
  1246. },
  1247. "type": {
  1248. "type": "integer"
  1249. },
  1250. "uuid": {
  1251. "type": "string"
  1252. }
  1253. }
  1254. },
  1255. "api.DeviceInfoInLogin": {
  1256. "type": "object",
  1257. "properties": {
  1258. "name": {
  1259. "type": "string"
  1260. },
  1261. "os": {
  1262. "type": "string"
  1263. },
  1264. "type": {
  1265. "type": "string"
  1266. }
  1267. }
  1268. },
  1269. "api.LoginForm": {
  1270. "type": "object",
  1271. "required": [
  1272. "username"
  1273. ],
  1274. "properties": {
  1275. "autoLogin": {
  1276. "type": "boolean"
  1277. },
  1278. "deviceInfo": {
  1279. "$ref": "#/definitions/api.DeviceInfoInLogin"
  1280. },
  1281. "id": {
  1282. "type": "string"
  1283. },
  1284. "password": {
  1285. "type": "string",
  1286. "maxLength": 20,
  1287. "minLength": 4
  1288. },
  1289. "type": {
  1290. "type": "string"
  1291. },
  1292. "username": {
  1293. "type": "string",
  1294. "maxLength": 10,
  1295. "minLength": 4
  1296. },
  1297. "uuid": {
  1298. "type": "string"
  1299. }
  1300. }
  1301. },
  1302. "api.LoginRes": {
  1303. "type": "object",
  1304. "properties": {
  1305. "access_token": {
  1306. "type": "string"
  1307. },
  1308. "secret": {
  1309. "type": "string"
  1310. },
  1311. "tfa_type": {
  1312. "type": "string"
  1313. },
  1314. "type": {
  1315. "type": "string"
  1316. },
  1317. "user": {
  1318. "$ref": "#/definitions/api.UserPayload"
  1319. }
  1320. }
  1321. },
  1322. "api.PeerForm": {
  1323. "type": "object",
  1324. "properties": {
  1325. "cpu": {
  1326. "type": "string"
  1327. },
  1328. "hostname": {
  1329. "type": "string"
  1330. },
  1331. "id": {
  1332. "type": "string"
  1333. },
  1334. "memory": {
  1335. "type": "string"
  1336. },
  1337. "os": {
  1338. "type": "string"
  1339. },
  1340. "username": {
  1341. "type": "string"
  1342. },
  1343. "uuid": {
  1344. "type": "string"
  1345. },
  1346. "version": {
  1347. "type": "string"
  1348. }
  1349. }
  1350. },
  1351. "api.UserPayload": {
  1352. "type": "object",
  1353. "properties": {
  1354. "email": {
  1355. "type": "string"
  1356. },
  1357. "info": {
  1358. "type": "object",
  1359. "additionalProperties": true
  1360. },
  1361. "is_admin": {
  1362. "type": "boolean"
  1363. },
  1364. "name": {
  1365. "type": "string"
  1366. },
  1367. "note": {
  1368. "type": "string"
  1369. },
  1370. "status": {
  1371. "type": "integer"
  1372. }
  1373. }
  1374. },
  1375. "model.Tag": {
  1376. "type": "object",
  1377. "properties": {
  1378. "color": {
  1379. "description": "color 是flutter的颜色值,从0x00000000 到 0xFFFFFFFF; 前两位表示透明度,后面6位表示颜色, 可以转成rgba",
  1380. "type": "integer"
  1381. },
  1382. "created_at": {
  1383. "type": "string"
  1384. },
  1385. "id": {
  1386. "type": "integer"
  1387. },
  1388. "name": {
  1389. "type": "string"
  1390. },
  1391. "updated_at": {
  1392. "type": "string"
  1393. },
  1394. "user_id": {
  1395. "type": "integer"
  1396. }
  1397. }
  1398. },
  1399. "model.TagList": {
  1400. "type": "object",
  1401. "properties": {
  1402. "list": {
  1403. "type": "array",
  1404. "items": {
  1405. "$ref": "#/definitions/model.Tag"
  1406. }
  1407. },
  1408. "page": {
  1409. "type": "integer"
  1410. },
  1411. "page_size": {
  1412. "type": "integer"
  1413. },
  1414. "total": {
  1415. "type": "integer"
  1416. }
  1417. }
  1418. },
  1419. "response.DataResponse": {
  1420. "type": "object",
  1421. "properties": {
  1422. "data": {},
  1423. "total": {
  1424. "type": "integer"
  1425. }
  1426. }
  1427. },
  1428. "response.ErrorResponse": {
  1429. "type": "object",
  1430. "properties": {
  1431. "error": {
  1432. "type": "string"
  1433. }
  1434. }
  1435. },
  1436. "response.Response": {
  1437. "type": "object",
  1438. "properties": {
  1439. "code": {
  1440. "type": "integer"
  1441. },
  1442. "data": {},
  1443. "message": {
  1444. "type": "string"
  1445. }
  1446. }
  1447. }
  1448. },
  1449. "securityDefinitions": {
  1450. "BearerAuth": {
  1451. "type": "apiKey",
  1452. "name": "Authorization",
  1453. "in": "header"
  1454. },
  1455. "token": {
  1456. "type": "apiKey",
  1457. "name": "api-token",
  1458. "in": "header"
  1459. }
  1460. }
  1461. }