api_swagger.json 41 KB

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