swagger.json 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "对抗训练",
  5. "title": "对抗训练",
  6. "contact": {
  7. "name": "Develoven"
  8. },
  9. "version": "1.0"
  10. },
  11. "paths": {
  12. "/v1/chat/create/answer": {
  13. "post": {
  14. "description": "录入答案",
  15. "consumes": [
  16. "application/json"
  17. ],
  18. "produces": [
  19. "application/json"
  20. ],
  21. "tags": [
  22. "问答管理"
  23. ],
  24. "summary": "录入答案",
  25. "parameters": [
  26. {
  27. "description": "questionNo:问题编号;NextQuestionNo:下一个问题编号;answer:答案",
  28. "name": "q",
  29. "in": "body",
  30. "required": true,
  31. "schema": {
  32. "type": "string"
  33. }
  34. }
  35. ],
  36. "responses": {
  37. "200": {
  38. "description": "ok",
  39. "schema": {
  40. "type": "string"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "/v1/chat/create/chat": {
  47. "post": {
  48. "description": "录入问题",
  49. "consumes": [
  50. "application/json"
  51. ],
  52. "produces": [
  53. "application/json"
  54. ],
  55. "tags": [
  56. "问答管理"
  57. ],
  58. "summary": "录入问题",
  59. "parameters": [
  60. {
  61. "description": "chat:问题;nextQuestionNo:下一个问题编号:如果此编号不为空,则说明此问题为陈述,没有答案信息;questionType:题目类型:0选择题;1填空题",
  62. "name": "q",
  63. "in": "body",
  64. "required": true,
  65. "schema": {
  66. "type": "string"
  67. }
  68. }
  69. ],
  70. "responses": {
  71. "200": {
  72. "description": "ok",
  73. "schema": {
  74. "type": "string"
  75. }
  76. }
  77. }
  78. }
  79. },
  80. "/v1/chat/get/answer": {
  81. "get": {
  82. "description": "查询答案",
  83. "consumes": [
  84. "application/json"
  85. ],
  86. "produces": [
  87. "application/json"
  88. ],
  89. "tags": [
  90. "问答管理"
  91. ],
  92. "summary": "查询答案",
  93. "parameters": [
  94. {
  95. "type": "integer",
  96. "description": "id:问题主键",
  97. "name": "id",
  98. "in": "query"
  99. }
  100. ],
  101. "responses": {
  102. "200": {
  103. "description": "ok",
  104. "schema": {
  105. "type": "string"
  106. }
  107. }
  108. }
  109. }
  110. },
  111. "/v1/chat/get/chat": {
  112. "get": {
  113. "description": "查询问题",
  114. "consumes": [
  115. "application/json"
  116. ],
  117. "produces": [
  118. "application/json"
  119. ],
  120. "tags": [
  121. "问答管理"
  122. ],
  123. "summary": "查询问题",
  124. "parameters": [
  125. {
  126. "type": "integer",
  127. "description": "id:问题主键",
  128. "name": "id",
  129. "in": "query"
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "ok",
  135. "schema": {
  136. "type": "string"
  137. }
  138. }
  139. }
  140. }
  141. },
  142. "/v1/device/:mac/disconnect": {
  143. "get": {
  144. "description": "断开连接",
  145. "consumes": [
  146. "application/json"
  147. ],
  148. "produces": [
  149. "application/json"
  150. ],
  151. "tags": [
  152. "设备管理"
  153. ],
  154. "summary": "断开连接",
  155. "responses": {
  156. "200": {
  157. "description": "ok",
  158. "schema": {
  159. "type": "string"
  160. }
  161. }
  162. }
  163. }
  164. },
  165. "/v1/device/:mac/remove": {
  166. "delete": {
  167. "description": "移除设备",
  168. "consumes": [
  169. "application/json"
  170. ],
  171. "produces": [
  172. "application/json"
  173. ],
  174. "tags": [
  175. "设备管理"
  176. ],
  177. "summary": "移除设备",
  178. "responses": {
  179. "200": {
  180. "description": "ok",
  181. "schema": {
  182. "type": "string"
  183. }
  184. }
  185. }
  186. }
  187. },
  188. "/v1/device/:mac/stop/collect": {
  189. "get": {
  190. "description": "停止采集",
  191. "consumes": [
  192. "application/json"
  193. ],
  194. "produces": [
  195. "application/json"
  196. ],
  197. "tags": [
  198. "设备管理"
  199. ],
  200. "summary": "停止采集",
  201. "responses": {
  202. "200": {
  203. "description": "ok",
  204. "schema": {
  205. "type": "string"
  206. }
  207. }
  208. }
  209. }
  210. },
  211. "/v1/device/:mac/stop/trans": {
  212. "get": {
  213. "description": "停止传输",
  214. "consumes": [
  215. "application/json"
  216. ],
  217. "produces": [
  218. "application/json"
  219. ],
  220. "tags": [
  221. "设备管理"
  222. ],
  223. "summary": "停止传输",
  224. "responses": {
  225. "200": {
  226. "description": "ok",
  227. "schema": {
  228. "type": "string"
  229. }
  230. }
  231. }
  232. }
  233. },
  234. "/v1/device/add": {
  235. "post": {
  236. "description": "新增设备",
  237. "consumes": [
  238. "application/json"
  239. ],
  240. "produces": [
  241. "application/json"
  242. ],
  243. "tags": [
  244. "设备管理"
  245. ],
  246. "summary": "新增设备",
  247. "parameters": [
  248. {
  249. "description": "type:类型 0脑电1心电;mac:设备MAC地址",
  250. "name": "device",
  251. "in": "body",
  252. "required": true,
  253. "schema": {
  254. "type": "string"
  255. }
  256. }
  257. ],
  258. "responses": {
  259. "200": {
  260. "description": "ok",
  261. "schema": {
  262. "type": "string"
  263. }
  264. }
  265. }
  266. }
  267. },
  268. "/v1/device/connected": {
  269. "get": {
  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. "schema": {
  285. "type": "string"
  286. }
  287. }
  288. }
  289. }
  290. },
  291. "/v1/device/connection": {
  292. "post": {
  293. "description": "连接设备",
  294. "consumes": [
  295. "application/json"
  296. ],
  297. "produces": [
  298. "application/json"
  299. ],
  300. "tags": [
  301. "设备管理"
  302. ],
  303. "summary": "连接设备",
  304. "parameters": [
  305. {
  306. "description": "chip:芯片编号,0或1;mac:Mac地址;addrType:地址类型 public/random ",
  307. "name": "device",
  308. "in": "body",
  309. "required": true,
  310. "schema": {
  311. "type": "string"
  312. }
  313. }
  314. ],
  315. "responses": {
  316. "200": {
  317. "description": "ok",
  318. "schema": {
  319. "type": "string"
  320. }
  321. }
  322. }
  323. }
  324. },
  325. "/v1/device/list/:type": {
  326. "get": {
  327. "description": "设备列表",
  328. "consumes": [
  329. "application/json"
  330. ],
  331. "produces": [
  332. "application/json"
  333. ],
  334. "tags": [
  335. "设备管理"
  336. ],
  337. "summary": "设备列表",
  338. "responses": {
  339. "200": {
  340. "description": "ok",
  341. "schema": {
  342. "type": "string"
  343. }
  344. }
  345. }
  346. }
  347. },
  348. "/v1/device/open/notify/": {
  349. "get": {
  350. "description": "开启数据通知",
  351. "consumes": [
  352. "application/json"
  353. ],
  354. "produces": [
  355. "application/json"
  356. ],
  357. "tags": [
  358. "设备管理"
  359. ],
  360. "summary": "开启数据通知",
  361. "responses": {
  362. "200": {
  363. "description": "ok",
  364. "schema": {
  365. "type": "string"
  366. }
  367. }
  368. }
  369. }
  370. },
  371. "/v1/device/scan": {
  372. "post": {
  373. "description": "扫描设备",
  374. "consumes": [
  375. "application/json"
  376. ],
  377. "produces": [
  378. "application/json"
  379. ],
  380. "tags": [
  381. "设备管理"
  382. ],
  383. "summary": "扫描设备",
  384. "parameters": [
  385. {
  386. "description": "chip:芯片编号,1或1;filterName:0 脑电 1 心电;filterRssi:信号强度,小于0的整数,字符串格式传输;filterMac:过滤Mac地址,以",
  387. "name": "device",
  388. "in": "body",
  389. "required": true,
  390. "schema": {
  391. "type": "string"
  392. }
  393. }
  394. ],
  395. "responses": {
  396. "200": {
  397. "description": "ok",
  398. "schema": {
  399. "type": "string"
  400. }
  401. }
  402. }
  403. }
  404. },
  405. "/v1/device/write/data/": {
  406. "post": {
  407. "description": "写入数据——发送指令 ,ECG设备开启测试功能",
  408. "consumes": [
  409. "application/json"
  410. ],
  411. "produces": [
  412. "application/json"
  413. ],
  414. "tags": [
  415. "设备管理"
  416. ],
  417. "summary": "写入数据——发送指令",
  418. "parameters": [
  419. {
  420. "description": "mac:设备MAC地址 userName:用户姓名 gender:性别 age:年龄 height:身高 weight:体重",
  421. "name": "mac",
  422. "in": "body",
  423. "required": true,
  424. "schema": {
  425. "type": "string"
  426. }
  427. }
  428. ],
  429. "responses": {
  430. "200": {
  431. "description": "ok",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. }
  437. }
  438. },
  439. "/v1/user/change/password": {
  440. "post": {
  441. "description": "用户修改密码",
  442. "consumes": [
  443. "application/json"
  444. ],
  445. "produces": [
  446. "application/json"
  447. ],
  448. "tags": [
  449. "用户管理"
  450. ],
  451. "summary": "用户修改密码",
  452. "parameters": [
  453. {
  454. "description": "userName:用户名 password:密码 newPassword:新密码",
  455. "name": "user",
  456. "in": "body",
  457. "required": true,
  458. "schema": {
  459. "type": "string"
  460. }
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "ok",
  466. "schema": {
  467. "type": "string"
  468. }
  469. }
  470. }
  471. }
  472. },
  473. "/v1/user/find": {
  474. "post": {
  475. "description": "用户列表查询",
  476. "consumes": [
  477. "application/json"
  478. ],
  479. "produces": [
  480. "application/json"
  481. ],
  482. "tags": [
  483. "用户管理"
  484. ],
  485. "summary": "用户列表查询",
  486. "parameters": [
  487. {
  488. "description": "role:角色;userName:用户名;pageNum:页数;pageSize:每页记录数",
  489. "name": "user",
  490. "in": "body",
  491. "required": true,
  492. "schema": {
  493. "type": "string"
  494. }
  495. }
  496. ],
  497. "responses": {
  498. "200": {
  499. "description": "ok",
  500. "schema": {
  501. "type": "string"
  502. }
  503. }
  504. }
  505. }
  506. },
  507. "/v1/user/login": {
  508. "post": {
  509. "description": "用户登录",
  510. "consumes": [
  511. "application/json"
  512. ],
  513. "produces": [
  514. "application/json"
  515. ],
  516. "tags": [
  517. "用户管理"
  518. ],
  519. "summary": "用户登录",
  520. "parameters": [
  521. {
  522. "description": "username:编号;password:密码;role:角色;",
  523. "name": "user",
  524. "in": "body",
  525. "required": true,
  526. "schema": {
  527. "type": "string"
  528. }
  529. }
  530. ],
  531. "responses": {
  532. "200": {
  533. "description": "ok",
  534. "schema": {
  535. "type": "string"
  536. }
  537. }
  538. }
  539. }
  540. },
  541. "/v1/user/register": {
  542. "post": {
  543. "description": "用户注册",
  544. "consumes": [
  545. "application/json"
  546. ],
  547. "produces": [
  548. "application/json"
  549. ],
  550. "tags": [
  551. "用户管理"
  552. ],
  553. "summary": "用户注册",
  554. "parameters": [
  555. {
  556. "description": "userName:用户名;password:密码;role:角色",
  557. "name": "user",
  558. "in": "body",
  559. "required": true,
  560. "schema": {
  561. "type": "string"
  562. }
  563. }
  564. ],
  565. "responses": {
  566. "200": {
  567. "description": "ok",
  568. "schema": {
  569. "type": "string"
  570. }
  571. }
  572. }
  573. }
  574. },
  575. "/v1/user/reset": {
  576. "post": {
  577. "description": "管理员重置普通用户密码",
  578. "consumes": [
  579. "application/json"
  580. ],
  581. "produces": [
  582. "application/json"
  583. ],
  584. "tags": [
  585. "用户管理"
  586. ],
  587. "summary": "管理员重置普通用户密码",
  588. "parameters": [
  589. {
  590. "description": "username:管理员编号;usernameInit:被重置用户编号",
  591. "name": "user",
  592. "in": "body",
  593. "required": true,
  594. "schema": {
  595. "type": "string"
  596. }
  597. }
  598. ],
  599. "responses": {
  600. "200": {
  601. "description": "ok",
  602. "schema": {
  603. "type": "string"
  604. }
  605. }
  606. }
  607. }
  608. },
  609. "/v2/device/conn": {
  610. "post": {
  611. "description": "连接设备",
  612. "consumes": [
  613. "application/json"
  614. ],
  615. "produces": [
  616. "application/json"
  617. ],
  618. "tags": [
  619. "设备管理"
  620. ],
  621. "summary": "连接设备",
  622. "parameters": [
  623. {
  624. "description": "mac:设备MAC地址 ai:终端BLE设备的地址ID at:终端BLE设备的地址类型 ",
  625. "name": "device",
  626. "in": "body",
  627. "required": true,
  628. "schema": {
  629. "type": "string"
  630. }
  631. }
  632. ],
  633. "responses": {
  634. "200": {
  635. "description": "ok",
  636. "schema": {
  637. "type": "string"
  638. }
  639. }
  640. }
  641. }
  642. },
  643. "/v2/device/connected/list": {
  644. "get": {
  645. "description": "已连接列表",
  646. "consumes": [
  647. "application/json"
  648. ],
  649. "produces": [
  650. "application/json"
  651. ],
  652. "tags": [
  653. "设备管理"
  654. ],
  655. "summary": "已连接列表 已连接列表中不再做任何处理,在连接或断开连接 成功或失败时系统自动调用",
  656. "responses": {
  657. "200": {
  658. "description": "ok",
  659. "schema": {
  660. "type": "string"
  661. }
  662. }
  663. }
  664. }
  665. },
  666. "/v2/device/dis/conn": {
  667. "post": {
  668. "description": "断开连接设备",
  669. "consumes": [
  670. "application/json"
  671. ],
  672. "produces": [
  673. "application/json"
  674. ],
  675. "tags": [
  676. "设备管理"
  677. ],
  678. "summary": "断开连接设备",
  679. "parameters": [
  680. {
  681. "description": "mac:设备MAC地址 ",
  682. "name": "device",
  683. "in": "body",
  684. "required": true,
  685. "schema": {
  686. "type": "string"
  687. }
  688. }
  689. ],
  690. "responses": {
  691. "200": {
  692. "description": "ok",
  693. "schema": {
  694. "type": "string"
  695. }
  696. }
  697. }
  698. }
  699. },
  700. "/v2/device/dis/connAll": {
  701. "get": {
  702. "description": "断开所有已连接设备",
  703. "consumes": [
  704. "application/json"
  705. ],
  706. "produces": [
  707. "application/json"
  708. ],
  709. "tags": [
  710. "设备管理"
  711. ],
  712. "summary": "断开所有已连接设备",
  713. "responses": {
  714. "200": {
  715. "description": "ok",
  716. "schema": {
  717. "type": "string"
  718. }
  719. }
  720. }
  721. }
  722. },
  723. "/v2/device/scan": {
  724. "get": {
  725. "description": "扫描设备",
  726. "consumes": [
  727. "application/json"
  728. ],
  729. "produces": [
  730. "application/json"
  731. ],
  732. "tags": [
  733. "设备管理"
  734. ],
  735. "summary": "扫描设备",
  736. "responses": {
  737. "200": {
  738. "description": "ok",
  739. "schema": {
  740. "type": "string"
  741. }
  742. }
  743. }
  744. }
  745. },
  746. "/v2/device/stop/scan": {
  747. "get": {
  748. "description": "停止扫描设备",
  749. "consumes": [
  750. "application/json"
  751. ],
  752. "produces": [
  753. "application/json"
  754. ],
  755. "tags": [
  756. "设备管理"
  757. ],
  758. "summary": "停止扫描设备",
  759. "responses": {
  760. "200": {
  761. "description": "ok",
  762. "schema": {
  763. "type": "string"
  764. }
  765. }
  766. }
  767. }
  768. },
  769. "/v2/device/write/data": {
  770. "post": {
  771. "description": "写入数据-脑电写入指令",
  772. "consumes": [
  773. "application/json"
  774. ],
  775. "produces": [
  776. "application/json"
  777. ],
  778. "tags": [
  779. "设备管理"
  780. ],
  781. "summary": "写入数据-脑电写入指令",
  782. "parameters": [
  783. {
  784. "description": "mac:设备MAC地址 userName:用户姓名 gender:性别 age:年龄 height:身高 weight:体重",
  785. "name": "mac",
  786. "in": "body",
  787. "required": true,
  788. "schema": {
  789. "type": "string"
  790. }
  791. }
  792. ],
  793. "responses": {
  794. "200": {
  795. "description": "ok",
  796. "schema": {
  797. "type": "string"
  798. }
  799. }
  800. }
  801. }
  802. },
  803. "/v2/gateway/find": {
  804. "get": {
  805. "description": "查询可能是蓝牙网关的设备",
  806. "consumes": [
  807. "application/json"
  808. ],
  809. "produces": [
  810. "application/json"
  811. ],
  812. "tags": [
  813. "设备管理"
  814. ],
  815. "summary": "查询可能是蓝牙网关的设备",
  816. "responses": {
  817. "200": {
  818. "description": "ok",
  819. "schema": {
  820. "type": "string"
  821. }
  822. }
  823. }
  824. }
  825. },
  826. "/v2/gateway/set": {
  827. "post": {
  828. "description": "保存网关MAC-脑电写入指令",
  829. "consumes": [
  830. "application/json"
  831. ],
  832. "produces": [
  833. "application/json"
  834. ],
  835. "tags": [
  836. "设备管理"
  837. ],
  838. "summary": "保存网关MAC",
  839. "parameters": [
  840. {
  841. "description": "mac:网关MAC地址 ",
  842. "name": "mac",
  843. "in": "body",
  844. "required": true,
  845. "schema": {
  846. "type": "string"
  847. }
  848. }
  849. ],
  850. "responses": {
  851. "200": {
  852. "description": "ok",
  853. "schema": {
  854. "type": "string"
  855. }
  856. }
  857. }
  858. }
  859. }
  860. }
  861. }