api_swagger.json 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642
  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. "/audit/conn": {
  650. "post": {
  651. "description": "审计连接",
  652. "consumes": [
  653. "application/json"
  654. ],
  655. "produces": [
  656. "application/json"
  657. ],
  658. "tags": [
  659. "审计"
  660. ],
  661. "summary": "审计连接",
  662. "parameters": [
  663. {
  664. "description": "审计连接",
  665. "name": "body",
  666. "in": "body",
  667. "required": true,
  668. "schema": {
  669. "$ref": "#/definitions/api.AuditConnForm"
  670. }
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "OK",
  676. "schema": {
  677. "type": "string"
  678. }
  679. },
  680. "500": {
  681. "description": "Internal Server Error",
  682. "schema": {
  683. "$ref": "#/definitions/response.Response"
  684. }
  685. }
  686. }
  687. }
  688. },
  689. "/audit/file": {
  690. "post": {
  691. "description": "审计文件",
  692. "consumes": [
  693. "application/json"
  694. ],
  695. "produces": [
  696. "application/json"
  697. ],
  698. "tags": [
  699. "审计"
  700. ],
  701. "summary": "审计文件",
  702. "parameters": [
  703. {
  704. "description": "审计文件",
  705. "name": "body",
  706. "in": "body",
  707. "required": true,
  708. "schema": {
  709. "$ref": "#/definitions/api.AuditFileForm"
  710. }
  711. }
  712. ],
  713. "responses": {
  714. "200": {
  715. "description": "OK",
  716. "schema": {
  717. "type": "string"
  718. }
  719. },
  720. "500": {
  721. "description": "Internal Server Error",
  722. "schema": {
  723. "$ref": "#/definitions/response.Response"
  724. }
  725. }
  726. }
  727. }
  728. },
  729. "/currentUser": {
  730. "get": {
  731. "security": [
  732. {
  733. "token": []
  734. }
  735. ],
  736. "description": "用户信息",
  737. "consumes": [
  738. "application/json"
  739. ],
  740. "produces": [
  741. "application/json"
  742. ],
  743. "tags": [
  744. "用户"
  745. ],
  746. "summary": "用户信息",
  747. "responses": {
  748. "200": {
  749. "description": "OK",
  750. "schema": {
  751. "$ref": "#/definitions/api.UserPayload"
  752. }
  753. },
  754. "500": {
  755. "description": "Internal Server Error",
  756. "schema": {
  757. "$ref": "#/definitions/response.Response"
  758. }
  759. }
  760. }
  761. }
  762. },
  763. "/device-group/accessible": {
  764. "get": {
  765. "security": [
  766. {
  767. "BearerAuth": []
  768. }
  769. ],
  770. "description": "机器",
  771. "consumes": [
  772. "application/json"
  773. ],
  774. "produces": [
  775. "application/json"
  776. ],
  777. "tags": [
  778. "群组"
  779. ],
  780. "summary": "设备",
  781. "parameters": [
  782. {
  783. "type": "integer",
  784. "description": "页码",
  785. "name": "page",
  786. "in": "query"
  787. },
  788. {
  789. "type": "integer",
  790. "description": "每页数量",
  791. "name": "pageSize",
  792. "in": "query"
  793. },
  794. {
  795. "type": "integer",
  796. "description": "状态",
  797. "name": "status",
  798. "in": "query"
  799. },
  800. {
  801. "type": "string",
  802. "description": "accessible",
  803. "name": "accessible",
  804. "in": "query"
  805. }
  806. ],
  807. "responses": {
  808. "200": {
  809. "description": "OK",
  810. "schema": {
  811. "$ref": "#/definitions/response.DataResponse"
  812. }
  813. },
  814. "500": {
  815. "description": "Internal Server Error",
  816. "schema": {
  817. "$ref": "#/definitions/response.Response"
  818. }
  819. }
  820. }
  821. }
  822. },
  823. "/heartbeat": {
  824. "post": {
  825. "description": "心跳",
  826. "consumes": [
  827. "application/json"
  828. ],
  829. "produces": [
  830. "application/json"
  831. ],
  832. "tags": [
  833. "首页"
  834. ],
  835. "summary": "心跳",
  836. "responses": {
  837. "200": {
  838. "description": "OK"
  839. },
  840. "500": {
  841. "description": "Internal Server Error",
  842. "schema": {
  843. "$ref": "#/definitions/response.Response"
  844. }
  845. }
  846. }
  847. }
  848. },
  849. "/login": {
  850. "post": {
  851. "description": "登录",
  852. "consumes": [
  853. "application/json"
  854. ],
  855. "produces": [
  856. "application/json"
  857. ],
  858. "tags": [
  859. "登录"
  860. ],
  861. "summary": "登录",
  862. "parameters": [
  863. {
  864. "description": "登录表单",
  865. "name": "body",
  866. "in": "body",
  867. "required": true,
  868. "schema": {
  869. "$ref": "#/definitions/api.LoginForm"
  870. }
  871. }
  872. ],
  873. "responses": {
  874. "200": {
  875. "description": "OK",
  876. "schema": {
  877. "$ref": "#/definitions/api.LoginRes"
  878. }
  879. },
  880. "500": {
  881. "description": "Internal Server Error",
  882. "schema": {
  883. "$ref": "#/definitions/response.ErrorResponse"
  884. }
  885. }
  886. }
  887. }
  888. },
  889. "/login-options": {
  890. "get": {
  891. "description": "登录选项",
  892. "consumes": [
  893. "application/json"
  894. ],
  895. "produces": [
  896. "application/json"
  897. ],
  898. "tags": [
  899. "登录"
  900. ],
  901. "summary": "登录选项",
  902. "responses": {
  903. "200": {
  904. "description": "OK",
  905. "schema": {
  906. "type": "array",
  907. "items": {
  908. "type": "string"
  909. }
  910. }
  911. },
  912. "500": {
  913. "description": "Internal Server Error",
  914. "schema": {
  915. "$ref": "#/definitions/response.ErrorResponse"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "/logout": {
  922. "post": {
  923. "description": "登出",
  924. "consumes": [
  925. "application/json"
  926. ],
  927. "produces": [
  928. "application/json"
  929. ],
  930. "tags": [
  931. "登录"
  932. ],
  933. "summary": "登出",
  934. "responses": {
  935. "200": {
  936. "description": "OK",
  937. "schema": {
  938. "type": "string"
  939. }
  940. },
  941. "500": {
  942. "description": "Internal Server Error",
  943. "schema": {
  944. "$ref": "#/definitions/response.ErrorResponse"
  945. }
  946. }
  947. }
  948. }
  949. },
  950. "/oauth/callback": {
  951. "get": {
  952. "description": "OauthCallback",
  953. "consumes": [
  954. "application/json"
  955. ],
  956. "produces": [
  957. "application/json"
  958. ],
  959. "tags": [
  960. "Oauth"
  961. ],
  962. "summary": "OauthCallback",
  963. "responses": {
  964. "200": {
  965. "description": "OK",
  966. "schema": {
  967. "$ref": "#/definitions/api.LoginRes"
  968. }
  969. },
  970. "500": {
  971. "description": "Internal Server Error",
  972. "schema": {
  973. "$ref": "#/definitions/response.ErrorResponse"
  974. }
  975. }
  976. }
  977. }
  978. },
  979. "/oidc/auth": {
  980. "post": {
  981. "description": "OidcAuth",
  982. "consumes": [
  983. "application/json"
  984. ],
  985. "produces": [
  986. "application/json"
  987. ],
  988. "tags": [
  989. "Oauth"
  990. ],
  991. "summary": "OidcAuth",
  992. "responses": {
  993. "200": {
  994. "description": "OK",
  995. "schema": {
  996. "$ref": "#/definitions/api.LoginRes"
  997. }
  998. },
  999. "500": {
  1000. "description": "Internal Server Error",
  1001. "schema": {
  1002. "$ref": "#/definitions/response.ErrorResponse"
  1003. }
  1004. }
  1005. }
  1006. }
  1007. },
  1008. "/oidc/auth-query": {
  1009. "get": {
  1010. "description": "OidcAuthQuery",
  1011. "consumes": [
  1012. "application/json"
  1013. ],
  1014. "produces": [
  1015. "application/json"
  1016. ],
  1017. "tags": [
  1018. "Oauth"
  1019. ],
  1020. "summary": "OidcAuthQuery",
  1021. "responses": {
  1022. "200": {
  1023. "description": "OK",
  1024. "schema": {
  1025. "$ref": "#/definitions/api.LoginRes"
  1026. }
  1027. },
  1028. "500": {
  1029. "description": "Internal Server Error",
  1030. "schema": {
  1031. "$ref": "#/definitions/response.ErrorResponse"
  1032. }
  1033. }
  1034. }
  1035. }
  1036. },
  1037. "/peers": {
  1038. "get": {
  1039. "security": [
  1040. {
  1041. "BearerAuth": []
  1042. }
  1043. ],
  1044. "description": "机器",
  1045. "consumes": [
  1046. "application/json"
  1047. ],
  1048. "produces": [
  1049. "application/json"
  1050. ],
  1051. "tags": [
  1052. "群组"
  1053. ],
  1054. "summary": "机器",
  1055. "parameters": [
  1056. {
  1057. "type": "integer",
  1058. "description": "页码",
  1059. "name": "page",
  1060. "in": "query"
  1061. },
  1062. {
  1063. "type": "integer",
  1064. "description": "每页数量",
  1065. "name": "pageSize",
  1066. "in": "query"
  1067. },
  1068. {
  1069. "type": "integer",
  1070. "description": "状态",
  1071. "name": "status",
  1072. "in": "query"
  1073. },
  1074. {
  1075. "type": "string",
  1076. "description": "accessible",
  1077. "name": "accessible",
  1078. "in": "query"
  1079. }
  1080. ],
  1081. "responses": {
  1082. "200": {
  1083. "description": "OK",
  1084. "schema": {
  1085. "$ref": "#/definitions/response.DataResponse"
  1086. }
  1087. },
  1088. "500": {
  1089. "description": "Internal Server Error",
  1090. "schema": {
  1091. "$ref": "#/definitions/response.Response"
  1092. }
  1093. }
  1094. }
  1095. }
  1096. },
  1097. "/server-config": {
  1098. "get": {
  1099. "security": [
  1100. {
  1101. "token": []
  1102. }
  1103. ],
  1104. "description": "服务配置,给webclient提供api-server",
  1105. "consumes": [
  1106. "application/json"
  1107. ],
  1108. "produces": [
  1109. "application/json"
  1110. ],
  1111. "tags": [
  1112. "WEBCLIENT"
  1113. ],
  1114. "summary": "服务配置",
  1115. "responses": {
  1116. "200": {
  1117. "description": "OK",
  1118. "schema": {
  1119. "$ref": "#/definitions/response.Response"
  1120. }
  1121. },
  1122. "500": {
  1123. "description": "Internal Server Error",
  1124. "schema": {
  1125. "$ref": "#/definitions/response.Response"
  1126. }
  1127. }
  1128. }
  1129. }
  1130. },
  1131. "/server-config-v2": {
  1132. "get": {
  1133. "security": [
  1134. {
  1135. "token": []
  1136. }
  1137. ],
  1138. "description": "服务配置,给webclient提供api-server",
  1139. "consumes": [
  1140. "application/json"
  1141. ],
  1142. "produces": [
  1143. "application/json"
  1144. ],
  1145. "tags": [
  1146. "WEBCLIENT_V2"
  1147. ],
  1148. "summary": "服务配置",
  1149. "responses": {
  1150. "200": {
  1151. "description": "OK",
  1152. "schema": {
  1153. "$ref": "#/definitions/response.Response"
  1154. }
  1155. },
  1156. "500": {
  1157. "description": "Internal Server Error",
  1158. "schema": {
  1159. "$ref": "#/definitions/response.Response"
  1160. }
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "/shared-peer": {
  1166. "post": {
  1167. "description": "分享的peer",
  1168. "consumes": [
  1169. "application/json"
  1170. ],
  1171. "produces": [
  1172. "application/json"
  1173. ],
  1174. "tags": [
  1175. "WEBCLIENT"
  1176. ],
  1177. "summary": "分享的peer",
  1178. "responses": {
  1179. "200": {
  1180. "description": "OK",
  1181. "schema": {
  1182. "$ref": "#/definitions/response.Response"
  1183. }
  1184. },
  1185. "500": {
  1186. "description": "Internal Server Error",
  1187. "schema": {
  1188. "$ref": "#/definitions/response.Response"
  1189. }
  1190. }
  1191. }
  1192. }
  1193. },
  1194. "/sysinfo": {
  1195. "post": {
  1196. "description": "提交系统信息",
  1197. "consumes": [
  1198. "application/json"
  1199. ],
  1200. "produces": [
  1201. "application/json"
  1202. ],
  1203. "tags": [
  1204. "地址"
  1205. ],
  1206. "summary": "提交系统信息",
  1207. "parameters": [
  1208. {
  1209. "description": "系统信息表单",
  1210. "name": "body",
  1211. "in": "body",
  1212. "required": true,
  1213. "schema": {
  1214. "$ref": "#/definitions/api.PeerForm"
  1215. }
  1216. }
  1217. ],
  1218. "responses": {
  1219. "200": {
  1220. "description": "SYSINFO_UPDATED,ID_NOT_FOUND",
  1221. "schema": {
  1222. "type": "string"
  1223. }
  1224. },
  1225. "500": {
  1226. "description": "Internal Server Error",
  1227. "schema": {
  1228. "$ref": "#/definitions/response.ErrorResponse"
  1229. }
  1230. }
  1231. }
  1232. }
  1233. },
  1234. "/users": {
  1235. "get": {
  1236. "security": [
  1237. {
  1238. "BearerAuth": []
  1239. }
  1240. ],
  1241. "description": "用户列表",
  1242. "consumes": [
  1243. "application/json"
  1244. ],
  1245. "produces": [
  1246. "application/json"
  1247. ],
  1248. "tags": [
  1249. "群组"
  1250. ],
  1251. "summary": "用户列表",
  1252. "parameters": [
  1253. {
  1254. "type": "integer",
  1255. "description": "页码",
  1256. "name": "page",
  1257. "in": "query"
  1258. },
  1259. {
  1260. "type": "integer",
  1261. "description": "每页数量",
  1262. "name": "pageSize",
  1263. "in": "query"
  1264. },
  1265. {
  1266. "type": "integer",
  1267. "description": "状态",
  1268. "name": "status",
  1269. "in": "query"
  1270. },
  1271. {
  1272. "type": "string",
  1273. "description": "accessible",
  1274. "name": "accessible",
  1275. "in": "query"
  1276. }
  1277. ],
  1278. "responses": {
  1279. "200": {
  1280. "description": "OK",
  1281. "schema": {
  1282. "allOf": [
  1283. {
  1284. "$ref": "#/definitions/response.DataResponse"
  1285. },
  1286. {
  1287. "type": "object",
  1288. "properties": {
  1289. "data": {
  1290. "type": "array",
  1291. "items": {
  1292. "$ref": "#/definitions/api.UserPayload"
  1293. }
  1294. }
  1295. }
  1296. }
  1297. ]
  1298. }
  1299. },
  1300. "500": {
  1301. "description": "Internal Server Error",
  1302. "schema": {
  1303. "$ref": "#/definitions/response.ErrorResponse"
  1304. }
  1305. }
  1306. }
  1307. }
  1308. },
  1309. "/version": {
  1310. "get": {
  1311. "description": "版本",
  1312. "consumes": [
  1313. "application/json"
  1314. ],
  1315. "produces": [
  1316. "application/json"
  1317. ],
  1318. "tags": [
  1319. "首页"
  1320. ],
  1321. "summary": "版本",
  1322. "responses": {
  1323. "200": {
  1324. "description": "OK",
  1325. "schema": {
  1326. "$ref": "#/definitions/response.Response"
  1327. }
  1328. },
  1329. "500": {
  1330. "description": "Internal Server Error",
  1331. "schema": {
  1332. "$ref": "#/definitions/response.Response"
  1333. }
  1334. }
  1335. }
  1336. }
  1337. }
  1338. },
  1339. "definitions": {
  1340. "api.AddressBookForm": {
  1341. "type": "object",
  1342. "properties": {
  1343. "data": {
  1344. "type": "string",
  1345. "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}\"}"
  1346. }
  1347. }
  1348. },
  1349. "api.AuditConnForm": {
  1350. "type": "object",
  1351. "properties": {
  1352. "action": {
  1353. "type": "string"
  1354. },
  1355. "conn_id": {
  1356. "type": "integer"
  1357. },
  1358. "id": {
  1359. "type": "string"
  1360. },
  1361. "ip": {
  1362. "type": "string"
  1363. },
  1364. "peer": {
  1365. "type": "array",
  1366. "items": {
  1367. "type": "string"
  1368. }
  1369. },
  1370. "session_id": {
  1371. "type": "number"
  1372. },
  1373. "type": {
  1374. "type": "integer"
  1375. },
  1376. "uuid": {
  1377. "type": "string"
  1378. }
  1379. }
  1380. },
  1381. "api.AuditFileForm": {
  1382. "type": "object",
  1383. "properties": {
  1384. "id": {
  1385. "type": "string"
  1386. },
  1387. "info": {
  1388. "type": "string"
  1389. },
  1390. "is_file": {
  1391. "type": "boolean"
  1392. },
  1393. "path": {
  1394. "type": "string"
  1395. },
  1396. "peer_id": {
  1397. "type": "string"
  1398. },
  1399. "type": {
  1400. "type": "integer"
  1401. },
  1402. "uuid": {
  1403. "type": "string"
  1404. }
  1405. }
  1406. },
  1407. "api.DeviceInfoInLogin": {
  1408. "type": "object",
  1409. "properties": {
  1410. "name": {
  1411. "type": "string"
  1412. },
  1413. "os": {
  1414. "type": "string"
  1415. },
  1416. "type": {
  1417. "type": "string"
  1418. }
  1419. }
  1420. },
  1421. "api.LoginForm": {
  1422. "type": "object",
  1423. "required": [
  1424. "username"
  1425. ],
  1426. "properties": {
  1427. "autoLogin": {
  1428. "type": "boolean"
  1429. },
  1430. "deviceInfo": {
  1431. "$ref": "#/definitions/api.DeviceInfoInLogin"
  1432. },
  1433. "id": {
  1434. "type": "string"
  1435. },
  1436. "password": {
  1437. "type": "string",
  1438. "maxLength": 32,
  1439. "minLength": 4
  1440. },
  1441. "type": {
  1442. "type": "string"
  1443. },
  1444. "username": {
  1445. "type": "string",
  1446. "maxLength": 32,
  1447. "minLength": 2
  1448. },
  1449. "uuid": {
  1450. "type": "string"
  1451. }
  1452. }
  1453. },
  1454. "api.LoginRes": {
  1455. "type": "object",
  1456. "properties": {
  1457. "access_token": {
  1458. "type": "string"
  1459. },
  1460. "secret": {
  1461. "type": "string"
  1462. },
  1463. "tfa_type": {
  1464. "type": "string"
  1465. },
  1466. "type": {
  1467. "type": "string"
  1468. },
  1469. "user": {
  1470. "$ref": "#/definitions/api.UserPayload"
  1471. }
  1472. }
  1473. },
  1474. "api.PeerForm": {
  1475. "type": "object",
  1476. "properties": {
  1477. "cpu": {
  1478. "type": "string"
  1479. },
  1480. "hostname": {
  1481. "type": "string"
  1482. },
  1483. "id": {
  1484. "type": "string"
  1485. },
  1486. "memory": {
  1487. "type": "string"
  1488. },
  1489. "os": {
  1490. "type": "string"
  1491. },
  1492. "username": {
  1493. "type": "string"
  1494. },
  1495. "uuid": {
  1496. "type": "string"
  1497. },
  1498. "version": {
  1499. "type": "string"
  1500. }
  1501. }
  1502. },
  1503. "api.UserPayload": {
  1504. "type": "object",
  1505. "properties": {
  1506. "email": {
  1507. "type": "string"
  1508. },
  1509. "info": {
  1510. "type": "object",
  1511. "additionalProperties": true
  1512. },
  1513. "is_admin": {
  1514. "type": "boolean"
  1515. },
  1516. "name": {
  1517. "type": "string"
  1518. },
  1519. "note": {
  1520. "type": "string"
  1521. },
  1522. "status": {
  1523. "type": "integer"
  1524. }
  1525. }
  1526. },
  1527. "model.AddressBookCollection": {
  1528. "type": "object",
  1529. "required": [
  1530. "name"
  1531. ],
  1532. "properties": {
  1533. "created_at": {
  1534. "type": "string"
  1535. },
  1536. "id": {
  1537. "type": "integer"
  1538. },
  1539. "name": {
  1540. "type": "string"
  1541. },
  1542. "updated_at": {
  1543. "type": "string"
  1544. },
  1545. "user_id": {
  1546. "type": "integer"
  1547. }
  1548. }
  1549. },
  1550. "model.Tag": {
  1551. "type": "object",
  1552. "properties": {
  1553. "collection": {
  1554. "$ref": "#/definitions/model.AddressBookCollection"
  1555. },
  1556. "collection_id": {
  1557. "type": "integer"
  1558. },
  1559. "color": {
  1560. "description": "color 是flutter的颜色值,从0x00000000 到 0xFFFFFFFF; 前两位表示透明度,后面6位表示颜色, 可以转成rgba",
  1561. "type": "integer"
  1562. },
  1563. "created_at": {
  1564. "type": "string"
  1565. },
  1566. "id": {
  1567. "type": "integer"
  1568. },
  1569. "name": {
  1570. "type": "string"
  1571. },
  1572. "updated_at": {
  1573. "type": "string"
  1574. },
  1575. "user_id": {
  1576. "type": "integer"
  1577. }
  1578. }
  1579. },
  1580. "model.TagList": {
  1581. "type": "object",
  1582. "properties": {
  1583. "list": {
  1584. "type": "array",
  1585. "items": {
  1586. "$ref": "#/definitions/model.Tag"
  1587. }
  1588. },
  1589. "page": {
  1590. "type": "integer"
  1591. },
  1592. "page_size": {
  1593. "type": "integer"
  1594. },
  1595. "total": {
  1596. "type": "integer"
  1597. }
  1598. }
  1599. },
  1600. "response.DataResponse": {
  1601. "type": "object",
  1602. "properties": {
  1603. "data": {},
  1604. "total": {
  1605. "type": "integer"
  1606. }
  1607. }
  1608. },
  1609. "response.ErrorResponse": {
  1610. "type": "object",
  1611. "properties": {
  1612. "error": {
  1613. "type": "string"
  1614. }
  1615. }
  1616. },
  1617. "response.Response": {
  1618. "type": "object",
  1619. "properties": {
  1620. "code": {
  1621. "type": "integer"
  1622. },
  1623. "data": {},
  1624. "message": {
  1625. "type": "string"
  1626. }
  1627. }
  1628. }
  1629. },
  1630. "securityDefinitions": {
  1631. "BearerAuth": {
  1632. "type": "apiKey",
  1633. "name": "Authorization",
  1634. "in": "header"
  1635. },
  1636. "token": {
  1637. "type": "apiKey",
  1638. "name": "api-token",
  1639. "in": "header"
  1640. }
  1641. }
  1642. }