api_docs.go 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  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. "地址"
  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/personal": {
  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. "用户"
  172. ],
  173. "summary": "个人信息",
  174. "parameters": [
  175. {
  176. "description": "string valid",
  177. "name": "string",
  178. "in": "body",
  179. "schema": {
  180. "type": "string"
  181. }
  182. }
  183. ],
  184. "responses": {
  185. "200": {
  186. "description": "OK",
  187. "schema": {
  188. "$ref": "#/definitions/response.Response"
  189. }
  190. },
  191. "500": {
  192. "description": "Internal Server Error",
  193. "schema": {
  194. "$ref": "#/definitions/response.Response"
  195. }
  196. }
  197. }
  198. }
  199. },
  200. "/api": {
  201. "get": {
  202. "security": [
  203. {
  204. "token": []
  205. }
  206. ],
  207. "description": "用户信息",
  208. "consumes": [
  209. "application/json"
  210. ],
  211. "produces": [
  212. "application/json"
  213. ],
  214. "tags": [
  215. "用户"
  216. ],
  217. "summary": "用户信息",
  218. "responses": {
  219. "200": {
  220. "description": "OK",
  221. "schema": {
  222. "$ref": "#/definitions/api.UserPayload"
  223. }
  224. },
  225. "500": {
  226. "description": "Internal Server Error",
  227. "schema": {
  228. "$ref": "#/definitions/response.Response"
  229. }
  230. }
  231. }
  232. }
  233. },
  234. "/currentUser": {
  235. "get": {
  236. "security": [
  237. {
  238. "token": []
  239. }
  240. ],
  241. "description": "用户信息",
  242. "consumes": [
  243. "application/json"
  244. ],
  245. "produces": [
  246. "application/json"
  247. ],
  248. "tags": [
  249. "用户"
  250. ],
  251. "summary": "用户信息",
  252. "responses": {
  253. "200": {
  254. "description": "OK",
  255. "schema": {
  256. "$ref": "#/definitions/api.UserPayload"
  257. }
  258. },
  259. "500": {
  260. "description": "Internal Server Error",
  261. "schema": {
  262. "$ref": "#/definitions/response.Response"
  263. }
  264. }
  265. }
  266. }
  267. },
  268. "/heartbeat": {
  269. "post": {
  270. "description": "心跳",
  271. "consumes": [
  272. "application/json"
  273. ],
  274. "produces": [
  275. "application/json"
  276. ],
  277. "tags": [
  278. "首页"
  279. ],
  280. "summary": "心跳",
  281. "responses": {
  282. "200": {
  283. "description": "OK"
  284. },
  285. "500": {
  286. "description": "Internal Server Error",
  287. "schema": {
  288. "$ref": "#/definitions/response.Response"
  289. }
  290. }
  291. }
  292. }
  293. },
  294. "/login": {
  295. "post": {
  296. "description": "登录",
  297. "consumes": [
  298. "application/json"
  299. ],
  300. "produces": [
  301. "application/json"
  302. ],
  303. "tags": [
  304. "登录"
  305. ],
  306. "summary": "登录",
  307. "parameters": [
  308. {
  309. "description": "登录表单",
  310. "name": "body",
  311. "in": "body",
  312. "required": true,
  313. "schema": {
  314. "$ref": "#/definitions/api.LoginForm"
  315. }
  316. }
  317. ],
  318. "responses": {
  319. "200": {
  320. "description": "OK",
  321. "schema": {
  322. "$ref": "#/definitions/api.LoginRes"
  323. }
  324. },
  325. "500": {
  326. "description": "Internal Server Error",
  327. "schema": {
  328. "$ref": "#/definitions/response.ErrorResponse"
  329. }
  330. }
  331. }
  332. }
  333. },
  334. "/login-options": {
  335. "post": {
  336. "description": "登录选项",
  337. "consumes": [
  338. "application/json"
  339. ],
  340. "produces": [
  341. "application/json"
  342. ],
  343. "tags": [
  344. "登录"
  345. ],
  346. "summary": "登录选项",
  347. "responses": {
  348. "200": {
  349. "description": "OK",
  350. "schema": {
  351. "type": "array",
  352. "items": {
  353. "type": "string"
  354. }
  355. }
  356. },
  357. "500": {
  358. "description": "Internal Server Error",
  359. "schema": {
  360. "$ref": "#/definitions/response.ErrorResponse"
  361. }
  362. }
  363. }
  364. }
  365. },
  366. "/logout": {
  367. "post": {
  368. "description": "登出",
  369. "consumes": [
  370. "application/json"
  371. ],
  372. "produces": [
  373. "application/json"
  374. ],
  375. "tags": [
  376. "登录"
  377. ],
  378. "summary": "登出",
  379. "responses": {
  380. "200": {
  381. "description": "OK",
  382. "schema": {
  383. "type": "string"
  384. }
  385. },
  386. "500": {
  387. "description": "Internal Server Error",
  388. "schema": {
  389. "$ref": "#/definitions/response.ErrorResponse"
  390. }
  391. }
  392. }
  393. }
  394. },
  395. "/peers": {
  396. "get": {
  397. "security": [
  398. {
  399. "BearerAuth": []
  400. }
  401. ],
  402. "description": "机器",
  403. "consumes": [
  404. "application/json"
  405. ],
  406. "produces": [
  407. "application/json"
  408. ],
  409. "tags": [
  410. "群组"
  411. ],
  412. "summary": "机器",
  413. "parameters": [
  414. {
  415. "type": "integer",
  416. "description": "页码",
  417. "name": "page",
  418. "in": "query"
  419. },
  420. {
  421. "type": "integer",
  422. "description": "每页数量",
  423. "name": "pageSize",
  424. "in": "query"
  425. },
  426. {
  427. "type": "integer",
  428. "description": "状态",
  429. "name": "status",
  430. "in": "query"
  431. },
  432. {
  433. "type": "string",
  434. "description": "accessible",
  435. "name": "accessible",
  436. "in": "query"
  437. }
  438. ],
  439. "responses": {
  440. "200": {
  441. "description": "OK",
  442. "schema": {
  443. "$ref": "#/definitions/response.DataResponse"
  444. }
  445. },
  446. "500": {
  447. "description": "Internal Server Error",
  448. "schema": {
  449. "$ref": "#/definitions/response.Response"
  450. }
  451. }
  452. }
  453. }
  454. },
  455. "/server-config": {
  456. "get": {
  457. "security": [
  458. {
  459. "token": []
  460. }
  461. ],
  462. "description": "服务配置,给webclient提供api-server",
  463. "consumes": [
  464. "application/json"
  465. ],
  466. "produces": [
  467. "application/json"
  468. ],
  469. "tags": [
  470. "WEBCLIENT"
  471. ],
  472. "summary": "服务配置",
  473. "responses": {
  474. "200": {
  475. "description": "OK",
  476. "schema": {
  477. "$ref": "#/definitions/response.Response"
  478. }
  479. },
  480. "500": {
  481. "description": "Internal Server Error",
  482. "schema": {
  483. "$ref": "#/definitions/response.Response"
  484. }
  485. }
  486. }
  487. }
  488. },
  489. "/sysinfo": {
  490. "post": {
  491. "security": [
  492. {
  493. "BearerAuth": []
  494. }
  495. ],
  496. "description": "提交系统信息",
  497. "consumes": [
  498. "application/json"
  499. ],
  500. "produces": [
  501. "application/json"
  502. ],
  503. "tags": [
  504. "地址"
  505. ],
  506. "summary": "提交系统信息",
  507. "parameters": [
  508. {
  509. "description": "系统信息表单",
  510. "name": "body",
  511. "in": "body",
  512. "required": true,
  513. "schema": {
  514. "$ref": "#/definitions/api.PeerForm"
  515. }
  516. }
  517. ],
  518. "responses": {
  519. "200": {
  520. "description": "SYSINFO_UPDATED,ID_NOT_FOUND",
  521. "schema": {
  522. "type": "string"
  523. }
  524. },
  525. "500": {
  526. "description": "Internal Server Error",
  527. "schema": {
  528. "$ref": "#/definitions/response.ErrorResponse"
  529. }
  530. }
  531. }
  532. }
  533. },
  534. "/tags": {
  535. "post": {
  536. "security": [
  537. {
  538. "BearerAuth": []
  539. }
  540. ],
  541. "description": "标签",
  542. "consumes": [
  543. "application/json"
  544. ],
  545. "produces": [
  546. "application/json"
  547. ],
  548. "tags": [
  549. "地址"
  550. ],
  551. "summary": "标签",
  552. "responses": {
  553. "200": {
  554. "description": "OK",
  555. "schema": {
  556. "type": "array",
  557. "items": {
  558. "$ref": "#/definitions/model.Tag"
  559. }
  560. }
  561. },
  562. "500": {
  563. "description": "Internal Server Error",
  564. "schema": {
  565. "$ref": "#/definitions/response.ErrorResponse"
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "/users": {
  572. "get": {
  573. "security": [
  574. {
  575. "BearerAuth": []
  576. }
  577. ],
  578. "description": "用户列表",
  579. "consumes": [
  580. "application/json"
  581. ],
  582. "produces": [
  583. "application/json"
  584. ],
  585. "tags": [
  586. "群组"
  587. ],
  588. "summary": "用户列表",
  589. "parameters": [
  590. {
  591. "type": "integer",
  592. "description": "页码",
  593. "name": "page",
  594. "in": "query"
  595. },
  596. {
  597. "type": "integer",
  598. "description": "每页数量",
  599. "name": "pageSize",
  600. "in": "query"
  601. },
  602. {
  603. "type": "integer",
  604. "description": "状态",
  605. "name": "status",
  606. "in": "query"
  607. },
  608. {
  609. "type": "string",
  610. "description": "accessible",
  611. "name": "accessible",
  612. "in": "query"
  613. }
  614. ],
  615. "responses": {
  616. "200": {
  617. "description": "OK",
  618. "schema": {
  619. "allOf": [
  620. {
  621. "$ref": "#/definitions/response.DataResponse"
  622. },
  623. {
  624. "type": "object",
  625. "properties": {
  626. "data": {
  627. "type": "array",
  628. "items": {
  629. "$ref": "#/definitions/api.UserPayload"
  630. }
  631. }
  632. }
  633. }
  634. ]
  635. }
  636. },
  637. "500": {
  638. "description": "Internal Server Error",
  639. "schema": {
  640. "$ref": "#/definitions/response.ErrorResponse"
  641. }
  642. }
  643. }
  644. }
  645. }
  646. },
  647. "definitions": {
  648. "api.AddressBookForm": {
  649. "type": "object",
  650. "properties": {
  651. "data": {
  652. "type": "string",
  653. "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}\"}"
  654. }
  655. }
  656. },
  657. "api.LoginForm": {
  658. "type": "object",
  659. "required": [
  660. "username"
  661. ],
  662. "properties": {
  663. "password": {
  664. "type": "string",
  665. "maxLength": 20,
  666. "minLength": 4
  667. },
  668. "username": {
  669. "type": "string",
  670. "maxLength": 10,
  671. "minLength": 4
  672. }
  673. }
  674. },
  675. "api.LoginRes": {
  676. "type": "object",
  677. "properties": {
  678. "access_token": {
  679. "type": "string"
  680. },
  681. "secret": {
  682. "type": "string"
  683. },
  684. "tfa_type": {
  685. "type": "string"
  686. },
  687. "type": {
  688. "type": "string"
  689. },
  690. "user": {
  691. "$ref": "#/definitions/api.UserPayload"
  692. }
  693. }
  694. },
  695. "api.PeerForm": {
  696. "type": "object",
  697. "properties": {
  698. "cpu": {
  699. "type": "string"
  700. },
  701. "hostname": {
  702. "type": "string"
  703. },
  704. "id": {
  705. "type": "string"
  706. },
  707. "memory": {
  708. "type": "string"
  709. },
  710. "os": {
  711. "type": "string"
  712. },
  713. "username": {
  714. "type": "string"
  715. },
  716. "uuid": {
  717. "type": "string"
  718. },
  719. "version": {
  720. "type": "string"
  721. }
  722. }
  723. },
  724. "api.UserPayload": {
  725. "type": "object",
  726. "properties": {
  727. "email": {
  728. "type": "string"
  729. },
  730. "is_admin": {
  731. "type": "boolean"
  732. },
  733. "name": {
  734. "type": "string"
  735. },
  736. "note": {
  737. "type": "string"
  738. },
  739. "status": {
  740. "type": "integer"
  741. }
  742. }
  743. },
  744. "model.Tag": {
  745. "type": "object",
  746. "properties": {
  747. "color": {
  748. "description": "color 是flutter的颜色值,从0x00000000 到 0xFFFFFFFF; 前两位表示透明度,后面6位表示颜色, 可以转成rgba",
  749. "type": "integer"
  750. },
  751. "created_at": {
  752. "type": "string"
  753. },
  754. "id": {
  755. "type": "integer"
  756. },
  757. "name": {
  758. "type": "string"
  759. },
  760. "updated_at": {
  761. "type": "string"
  762. },
  763. "user_id": {
  764. "type": "integer"
  765. }
  766. }
  767. },
  768. "response.DataResponse": {
  769. "type": "object",
  770. "properties": {
  771. "data": {},
  772. "total": {
  773. "type": "integer"
  774. }
  775. }
  776. },
  777. "response.ErrorResponse": {
  778. "type": "object",
  779. "properties": {
  780. "error": {
  781. "type": "string"
  782. }
  783. }
  784. },
  785. "response.Response": {
  786. "type": "object",
  787. "properties": {
  788. "code": {
  789. "type": "integer"
  790. },
  791. "data": {},
  792. "message": {
  793. "type": "string"
  794. }
  795. }
  796. }
  797. },
  798. "securityDefinitions": {
  799. "BearerAuth": {
  800. "type": "apiKey",
  801. "name": "Authorization",
  802. "in": "header"
  803. },
  804. "token": {
  805. "type": "apiKey",
  806. "name": "api-token",
  807. "in": "header"
  808. }
  809. }
  810. }`
  811. // SwaggerInfoapi holds exported Swagger Info so clients can modify it
  812. var SwaggerInfoapi = &swag.Spec{
  813. Version: "1.0",
  814. Host: "",
  815. BasePath: "/api",
  816. Schemes: []string{},
  817. Title: "管理系统API",
  818. Description: "接口",
  819. InfoInstanceName: "api",
  820. SwaggerTemplate: docTemplateapi,
  821. LeftDelim: "{{",
  822. RightDelim: "}}",
  823. }
  824. func init() {
  825. swag.Register(SwaggerInfoapi.InstanceName(), SwaggerInfoapi)
  826. }