api_docs.go 42 KB

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