swagger.json 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  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/connection": {
  269. "post": {
  270. "description": "连接设备",
  271. "consumes": [
  272. "application/json"
  273. ],
  274. "produces": [
  275. "application/json"
  276. ],
  277. "tags": [
  278. "设备管理"
  279. ],
  280. "summary": "连接设备",
  281. "parameters": [
  282. {
  283. "description": "chip:芯片编号,0或1;mac:Mac地址;addrType:地址类型 public/random ",
  284. "name": "device",
  285. "in": "body",
  286. "required": true,
  287. "schema": {
  288. "type": "string"
  289. }
  290. }
  291. ],
  292. "responses": {
  293. "200": {
  294. "description": "ok",
  295. "schema": {
  296. "type": "string"
  297. }
  298. }
  299. }
  300. }
  301. },
  302. "/v1/device/list/:type": {
  303. "get": {
  304. "description": "设备列表",
  305. "consumes": [
  306. "application/json"
  307. ],
  308. "produces": [
  309. "application/json"
  310. ],
  311. "tags": [
  312. "设备管理"
  313. ],
  314. "summary": "设备列表",
  315. "responses": {
  316. "200": {
  317. "description": "ok",
  318. "schema": {
  319. "type": "string"
  320. }
  321. }
  322. }
  323. }
  324. },
  325. "/v1/device/open/notify/": {
  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/scan": {
  349. "post": {
  350. "description": "扫描设备",
  351. "consumes": [
  352. "application/json"
  353. ],
  354. "produces": [
  355. "application/json"
  356. ],
  357. "tags": [
  358. "设备管理"
  359. ],
  360. "summary": "扫描设备",
  361. "parameters": [
  362. {
  363. "description": "chip:芯片编号,1或1;filterName:0 脑电 1 心电;filterRssi:信号强度,小于0的整数,字符串格式传输;filterMac:过滤Mac地址,以",
  364. "name": "device",
  365. "in": "body",
  366. "required": true,
  367. "schema": {
  368. "type": "string"
  369. }
  370. }
  371. ],
  372. "responses": {
  373. "200": {
  374. "description": "ok",
  375. "schema": {
  376. "type": "string"
  377. }
  378. }
  379. }
  380. }
  381. },
  382. "/v1/device/write/data/": {
  383. "post": {
  384. "description": "写入数据——发送指令 ,ECG设备开启测试功能",
  385. "consumes": [
  386. "application/json"
  387. ],
  388. "produces": [
  389. "application/json"
  390. ],
  391. "tags": [
  392. "设备管理"
  393. ],
  394. "summary": "写入数据——发送指令",
  395. "parameters": [
  396. {
  397. "description": "mac:设备MAC地址 userName:用户姓名 gender:性别 age:年龄 height:身高 weight:体重",
  398. "name": "mac",
  399. "in": "body",
  400. "required": true,
  401. "schema": {
  402. "type": "string"
  403. }
  404. }
  405. ],
  406. "responses": {
  407. "200": {
  408. "description": "ok",
  409. "schema": {
  410. "type": "string"
  411. }
  412. }
  413. }
  414. }
  415. },
  416. "/v1/user/change/password": {
  417. "post": {
  418. "description": "用户修改密码",
  419. "consumes": [
  420. "application/json"
  421. ],
  422. "produces": [
  423. "application/json"
  424. ],
  425. "tags": [
  426. "用户管理"
  427. ],
  428. "summary": "用户修改密码",
  429. "parameters": [
  430. {
  431. "description": "userName:用户名 password:密码 newPassword:新密码",
  432. "name": "user",
  433. "in": "body",
  434. "required": true,
  435. "schema": {
  436. "type": "string"
  437. }
  438. }
  439. ],
  440. "responses": {
  441. "200": {
  442. "description": "ok",
  443. "schema": {
  444. "type": "string"
  445. }
  446. }
  447. }
  448. }
  449. },
  450. "/v1/user/find": {
  451. "post": {
  452. "description": "用户列表查询",
  453. "consumes": [
  454. "application/json"
  455. ],
  456. "produces": [
  457. "application/json"
  458. ],
  459. "tags": [
  460. "用户管理"
  461. ],
  462. "summary": "用户列表查询",
  463. "parameters": [
  464. {
  465. "description": "role:角色;userName:用户名;pageNum:页数;pageSize:每页记录数",
  466. "name": "user",
  467. "in": "body",
  468. "required": true,
  469. "schema": {
  470. "type": "string"
  471. }
  472. }
  473. ],
  474. "responses": {
  475. "200": {
  476. "description": "ok",
  477. "schema": {
  478. "type": "string"
  479. }
  480. }
  481. }
  482. }
  483. },
  484. "/v1/user/login": {
  485. "post": {
  486. "description": "用户登录",
  487. "consumes": [
  488. "application/json"
  489. ],
  490. "produces": [
  491. "application/json"
  492. ],
  493. "tags": [
  494. "用户管理"
  495. ],
  496. "summary": "用户登录",
  497. "parameters": [
  498. {
  499. "description": "username:编号;password:密码;role:角色;",
  500. "name": "user",
  501. "in": "body",
  502. "required": true,
  503. "schema": {
  504. "type": "string"
  505. }
  506. }
  507. ],
  508. "responses": {
  509. "200": {
  510. "description": "ok",
  511. "schema": {
  512. "type": "string"
  513. }
  514. }
  515. }
  516. }
  517. },
  518. "/v1/user/register": {
  519. "post": {
  520. "description": "用户注册",
  521. "consumes": [
  522. "application/json"
  523. ],
  524. "produces": [
  525. "application/json"
  526. ],
  527. "tags": [
  528. "用户管理"
  529. ],
  530. "summary": "用户注册",
  531. "parameters": [
  532. {
  533. "description": "userName:用户名;password:密码;role:角色",
  534. "name": "user",
  535. "in": "body",
  536. "required": true,
  537. "schema": {
  538. "type": "string"
  539. }
  540. }
  541. ],
  542. "responses": {
  543. "200": {
  544. "description": "ok",
  545. "schema": {
  546. "type": "string"
  547. }
  548. }
  549. }
  550. }
  551. },
  552. "/v1/user/reset": {
  553. "post": {
  554. "description": "管理员重置普通用户密码",
  555. "consumes": [
  556. "application/json"
  557. ],
  558. "produces": [
  559. "application/json"
  560. ],
  561. "tags": [
  562. "用户管理"
  563. ],
  564. "summary": "管理员重置普通用户密码",
  565. "parameters": [
  566. {
  567. "description": "username:管理员编号;usernameInit:被重置用户编号",
  568. "name": "user",
  569. "in": "body",
  570. "required": true,
  571. "schema": {
  572. "type": "string"
  573. }
  574. }
  575. ],
  576. "responses": {
  577. "200": {
  578. "description": "ok",
  579. "schema": {
  580. "type": "string"
  581. }
  582. }
  583. }
  584. }
  585. }
  586. }
  587. }