api_swagger.json 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671
  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. "/oidc/auth": {
  951. "post": {
  952. "description": "OidcAuth",
  953. "consumes": [
  954. "application/json"
  955. ],
  956. "produces": [
  957. "application/json"
  958. ],
  959. "tags": [
  960. "Oauth"
  961. ],
  962. "summary": "OidcAuth",
  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-query": {
  980. "get": {
  981. "description": "OidcAuthQuery",
  982. "consumes": [
  983. "application/json"
  984. ],
  985. "produces": [
  986. "application/json"
  987. ],
  988. "tags": [
  989. "Oauth"
  990. ],
  991. "summary": "OidcAuthQuery",
  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/callback": {
  1009. "get": {
  1010. "description": "OauthCallback",
  1011. "consumes": [
  1012. "application/json"
  1013. ],
  1014. "produces": [
  1015. "application/json"
  1016. ],
  1017. "tags": [
  1018. "Oauth"
  1019. ],
  1020. "summary": "OauthCallback",
  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. "System"
  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. "/sysinfo_ver": {
  1235. "post": {
  1236. "description": "获取系统版本信息",
  1237. "consumes": [
  1238. "application/json"
  1239. ],
  1240. "produces": [
  1241. "application/json"
  1242. ],
  1243. "tags": [
  1244. "System"
  1245. ],
  1246. "summary": "获取系统版本信息",
  1247. "responses": {
  1248. "200": {
  1249. "description": "OK",
  1250. "schema": {
  1251. "type": "string"
  1252. }
  1253. },
  1254. "500": {
  1255. "description": "Internal Server Error",
  1256. "schema": {
  1257. "$ref": "#/definitions/response.ErrorResponse"
  1258. }
  1259. }
  1260. }
  1261. }
  1262. },
  1263. "/users": {
  1264. "get": {
  1265. "security": [
  1266. {
  1267. "BearerAuth": []
  1268. }
  1269. ],
  1270. "description": "用户列表",
  1271. "consumes": [
  1272. "application/json"
  1273. ],
  1274. "produces": [
  1275. "application/json"
  1276. ],
  1277. "tags": [
  1278. "群组"
  1279. ],
  1280. "summary": "用户列表",
  1281. "parameters": [
  1282. {
  1283. "type": "integer",
  1284. "description": "页码",
  1285. "name": "page",
  1286. "in": "query"
  1287. },
  1288. {
  1289. "type": "integer",
  1290. "description": "每页数量",
  1291. "name": "pageSize",
  1292. "in": "query"
  1293. },
  1294. {
  1295. "type": "integer",
  1296. "description": "状态",
  1297. "name": "status",
  1298. "in": "query"
  1299. },
  1300. {
  1301. "type": "string",
  1302. "description": "accessible",
  1303. "name": "accessible",
  1304. "in": "query"
  1305. }
  1306. ],
  1307. "responses": {
  1308. "200": {
  1309. "description": "OK",
  1310. "schema": {
  1311. "allOf": [
  1312. {
  1313. "$ref": "#/definitions/response.DataResponse"
  1314. },
  1315. {
  1316. "type": "object",
  1317. "properties": {
  1318. "data": {
  1319. "type": "array",
  1320. "items": {
  1321. "$ref": "#/definitions/api.UserPayload"
  1322. }
  1323. }
  1324. }
  1325. }
  1326. ]
  1327. }
  1328. },
  1329. "500": {
  1330. "description": "Internal Server Error",
  1331. "schema": {
  1332. "$ref": "#/definitions/response.ErrorResponse"
  1333. }
  1334. }
  1335. }
  1336. }
  1337. },
  1338. "/version": {
  1339. "get": {
  1340. "description": "版本",
  1341. "consumes": [
  1342. "application/json"
  1343. ],
  1344. "produces": [
  1345. "application/json"
  1346. ],
  1347. "tags": [
  1348. "首页"
  1349. ],
  1350. "summary": "版本",
  1351. "responses": {
  1352. "200": {
  1353. "description": "OK",
  1354. "schema": {
  1355. "$ref": "#/definitions/response.Response"
  1356. }
  1357. },
  1358. "500": {
  1359. "description": "Internal Server Error",
  1360. "schema": {
  1361. "$ref": "#/definitions/response.Response"
  1362. }
  1363. }
  1364. }
  1365. }
  1366. }
  1367. },
  1368. "definitions": {
  1369. "api.AddressBookForm": {
  1370. "type": "object",
  1371. "properties": {
  1372. "data": {
  1373. "type": "string",
  1374. "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}\"}"
  1375. }
  1376. }
  1377. },
  1378. "api.AuditConnForm": {
  1379. "type": "object",
  1380. "properties": {
  1381. "action": {
  1382. "type": "string"
  1383. },
  1384. "conn_id": {
  1385. "type": "integer"
  1386. },
  1387. "id": {
  1388. "type": "string"
  1389. },
  1390. "ip": {
  1391. "type": "string"
  1392. },
  1393. "peer": {
  1394. "type": "array",
  1395. "items": {
  1396. "type": "string"
  1397. }
  1398. },
  1399. "session_id": {
  1400. "type": "number"
  1401. },
  1402. "type": {
  1403. "type": "integer"
  1404. },
  1405. "uuid": {
  1406. "type": "string"
  1407. }
  1408. }
  1409. },
  1410. "api.AuditFileForm": {
  1411. "type": "object",
  1412. "properties": {
  1413. "id": {
  1414. "type": "string"
  1415. },
  1416. "info": {
  1417. "type": "string"
  1418. },
  1419. "is_file": {
  1420. "type": "boolean"
  1421. },
  1422. "path": {
  1423. "type": "string"
  1424. },
  1425. "peer_id": {
  1426. "type": "string"
  1427. },
  1428. "type": {
  1429. "type": "integer"
  1430. },
  1431. "uuid": {
  1432. "type": "string"
  1433. }
  1434. }
  1435. },
  1436. "api.DeviceInfoInLogin": {
  1437. "type": "object",
  1438. "properties": {
  1439. "name": {
  1440. "type": "string"
  1441. },
  1442. "os": {
  1443. "type": "string"
  1444. },
  1445. "type": {
  1446. "type": "string"
  1447. }
  1448. }
  1449. },
  1450. "api.LoginForm": {
  1451. "type": "object",
  1452. "required": [
  1453. "username"
  1454. ],
  1455. "properties": {
  1456. "autoLogin": {
  1457. "type": "boolean"
  1458. },
  1459. "deviceInfo": {
  1460. "$ref": "#/definitions/api.DeviceInfoInLogin"
  1461. },
  1462. "id": {
  1463. "type": "string"
  1464. },
  1465. "password": {
  1466. "type": "string",
  1467. "maxLength": 32,
  1468. "minLength": 4
  1469. },
  1470. "type": {
  1471. "type": "string"
  1472. },
  1473. "username": {
  1474. "type": "string",
  1475. "maxLength": 32,
  1476. "minLength": 2
  1477. },
  1478. "uuid": {
  1479. "type": "string"
  1480. }
  1481. }
  1482. },
  1483. "api.LoginRes": {
  1484. "type": "object",
  1485. "properties": {
  1486. "access_token": {
  1487. "type": "string"
  1488. },
  1489. "secret": {
  1490. "type": "string"
  1491. },
  1492. "tfa_type": {
  1493. "type": "string"
  1494. },
  1495. "type": {
  1496. "type": "string"
  1497. },
  1498. "user": {
  1499. "$ref": "#/definitions/api.UserPayload"
  1500. }
  1501. }
  1502. },
  1503. "api.PeerForm": {
  1504. "type": "object",
  1505. "properties": {
  1506. "cpu": {
  1507. "type": "string"
  1508. },
  1509. "hostname": {
  1510. "type": "string"
  1511. },
  1512. "id": {
  1513. "type": "string"
  1514. },
  1515. "memory": {
  1516. "type": "string"
  1517. },
  1518. "os": {
  1519. "type": "string"
  1520. },
  1521. "username": {
  1522. "type": "string"
  1523. },
  1524. "uuid": {
  1525. "type": "string"
  1526. },
  1527. "version": {
  1528. "type": "string"
  1529. }
  1530. }
  1531. },
  1532. "api.UserPayload": {
  1533. "type": "object",
  1534. "properties": {
  1535. "email": {
  1536. "type": "string"
  1537. },
  1538. "info": {
  1539. "type": "object",
  1540. "additionalProperties": true
  1541. },
  1542. "is_admin": {
  1543. "type": "boolean"
  1544. },
  1545. "name": {
  1546. "type": "string"
  1547. },
  1548. "note": {
  1549. "type": "string"
  1550. },
  1551. "status": {
  1552. "type": "integer"
  1553. }
  1554. }
  1555. },
  1556. "model.AddressBookCollection": {
  1557. "type": "object",
  1558. "required": [
  1559. "name"
  1560. ],
  1561. "properties": {
  1562. "created_at": {
  1563. "type": "string"
  1564. },
  1565. "id": {
  1566. "type": "integer"
  1567. },
  1568. "name": {
  1569. "type": "string"
  1570. },
  1571. "updated_at": {
  1572. "type": "string"
  1573. },
  1574. "user_id": {
  1575. "type": "integer"
  1576. }
  1577. }
  1578. },
  1579. "model.Tag": {
  1580. "type": "object",
  1581. "properties": {
  1582. "collection": {
  1583. "$ref": "#/definitions/model.AddressBookCollection"
  1584. },
  1585. "collection_id": {
  1586. "type": "integer"
  1587. },
  1588. "color": {
  1589. "description": "color 是flutter的颜色值,从0x00000000 到 0xFFFFFFFF; 前两位表示透明度,后面6位表示颜色, 可以转成rgba",
  1590. "type": "integer"
  1591. },
  1592. "created_at": {
  1593. "type": "string"
  1594. },
  1595. "id": {
  1596. "type": "integer"
  1597. },
  1598. "name": {
  1599. "type": "string"
  1600. },
  1601. "updated_at": {
  1602. "type": "string"
  1603. },
  1604. "user_id": {
  1605. "type": "integer"
  1606. }
  1607. }
  1608. },
  1609. "model.TagList": {
  1610. "type": "object",
  1611. "properties": {
  1612. "list": {
  1613. "type": "array",
  1614. "items": {
  1615. "$ref": "#/definitions/model.Tag"
  1616. }
  1617. },
  1618. "page": {
  1619. "type": "integer"
  1620. },
  1621. "page_size": {
  1622. "type": "integer"
  1623. },
  1624. "total": {
  1625. "type": "integer"
  1626. }
  1627. }
  1628. },
  1629. "response.DataResponse": {
  1630. "type": "object",
  1631. "properties": {
  1632. "data": {},
  1633. "total": {
  1634. "type": "integer"
  1635. }
  1636. }
  1637. },
  1638. "response.ErrorResponse": {
  1639. "type": "object",
  1640. "properties": {
  1641. "error": {
  1642. "type": "string"
  1643. }
  1644. }
  1645. },
  1646. "response.Response": {
  1647. "type": "object",
  1648. "properties": {
  1649. "code": {
  1650. "type": "integer"
  1651. },
  1652. "data": {},
  1653. "message": {
  1654. "type": "string"
  1655. }
  1656. }
  1657. }
  1658. },
  1659. "securityDefinitions": {
  1660. "BearerAuth": {
  1661. "type": "apiKey",
  1662. "name": "Authorization",
  1663. "in": "header"
  1664. },
  1665. "token": {
  1666. "type": "apiKey",
  1667. "name": "api-token",
  1668. "in": "header"
  1669. }
  1670. }
  1671. }