admin_swagger.yaml 32 KB

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