swagger.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  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. "delete": {
  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/stop/collect": {
  166. "get": {
  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/trans": {
  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/add": {
  212. "post": {
  213. "description": "新增设备",
  214. "consumes": [
  215. "application/json"
  216. ],
  217. "produces": [
  218. "application/json"
  219. ],
  220. "tags": [
  221. "设备管理"
  222. ],
  223. "summary": "新增设备",
  224. "parameters": [
  225. {
  226. "description": "type:类型 0脑电1心电;mac:设备MAC地址",
  227. "name": "device",
  228. "in": "body",
  229. "required": true,
  230. "schema": {
  231. "type": "string"
  232. }
  233. }
  234. ],
  235. "responses": {
  236. "200": {
  237. "description": "ok",
  238. "schema": {
  239. "type": "string"
  240. }
  241. }
  242. }
  243. }
  244. },
  245. "/v1/device/connection": {
  246. "get": {
  247. "description": "连接设备",
  248. "consumes": [
  249. "application/json"
  250. ],
  251. "produces": [
  252. "application/json"
  253. ],
  254. "tags": [
  255. "设备管理"
  256. ],
  257. "summary": "连接设备",
  258. "parameters": [
  259. {
  260. "description": "chip:芯片编号,0或1;mac:Mac地址;addrType:地址类型 public/random ",
  261. "name": "device",
  262. "in": "body",
  263. "required": true,
  264. "schema": {
  265. "type": "string"
  266. }
  267. }
  268. ],
  269. "responses": {
  270. "200": {
  271. "description": "ok",
  272. "schema": {
  273. "type": "string"
  274. }
  275. }
  276. }
  277. }
  278. },
  279. "/v1/device/open/notify/": {
  280. "get": {
  281. "description": "开启数据通知",
  282. "consumes": [
  283. "application/json"
  284. ],
  285. "produces": [
  286. "application/json"
  287. ],
  288. "tags": [
  289. "设备管理"
  290. ],
  291. "summary": "开启数据通知",
  292. "responses": {
  293. "200": {
  294. "description": "ok",
  295. "schema": {
  296. "type": "string"
  297. }
  298. }
  299. }
  300. }
  301. },
  302. "/v1/device/scan": {
  303. "get": {
  304. "description": "扫描设备",
  305. "consumes": [
  306. "application/json"
  307. ],
  308. "produces": [
  309. "application/json"
  310. ],
  311. "tags": [
  312. "设备管理"
  313. ],
  314. "summary": "扫描设备",
  315. "parameters": [
  316. {
  317. "description": "chip:芯片编号,1或1;filterName:0 脑电 1 心电;filterRssi:信号强度,小于0的整数,字符串格式传输;filterMac:过滤Mac地址,以",
  318. "name": "device",
  319. "in": "body",
  320. "required": true,
  321. "schema": {
  322. "type": "string"
  323. }
  324. }
  325. ],
  326. "responses": {
  327. "200": {
  328. "description": "ok",
  329. "schema": {
  330. "type": "string"
  331. }
  332. }
  333. }
  334. }
  335. },
  336. "/v1/device/write/data/": {
  337. "post": {
  338. "description": "写入数据——发送指令 ,ECG设备开启测试功能",
  339. "consumes": [
  340. "application/json"
  341. ],
  342. "produces": [
  343. "application/json"
  344. ],
  345. "tags": [
  346. "设备管理"
  347. ],
  348. "summary": "写入数据——发送指令",
  349. "parameters": [
  350. {
  351. "description": "mac:设备MAC地址 userName:用户姓名 gender:性别 age:年龄 height:身高 weight:体重",
  352. "name": "mac",
  353. "in": "body",
  354. "required": true,
  355. "schema": {
  356. "type": "string"
  357. }
  358. }
  359. ],
  360. "responses": {
  361. "200": {
  362. "description": "ok",
  363. "schema": {
  364. "type": "string"
  365. }
  366. }
  367. }
  368. }
  369. },
  370. "/v1/user/change/password": {
  371. "post": {
  372. "description": "用户修改密码",
  373. "consumes": [
  374. "application/json"
  375. ],
  376. "produces": [
  377. "application/json"
  378. ],
  379. "tags": [
  380. "用户管理"
  381. ],
  382. "summary": "用户修改密码",
  383. "parameters": [
  384. {
  385. "description": "userName:用户名 password:密码 newPassword:新密码",
  386. "name": "user",
  387. "in": "body",
  388. "required": true,
  389. "schema": {
  390. "type": "string"
  391. }
  392. }
  393. ],
  394. "responses": {
  395. "200": {
  396. "description": "ok",
  397. "schema": {
  398. "type": "string"
  399. }
  400. }
  401. }
  402. }
  403. },
  404. "/v1/user/find": {
  405. "post": {
  406. "description": "用户列表查询",
  407. "consumes": [
  408. "application/json"
  409. ],
  410. "produces": [
  411. "application/json"
  412. ],
  413. "tags": [
  414. "用户管理"
  415. ],
  416. "summary": "用户列表查询",
  417. "parameters": [
  418. {
  419. "description": "role:角色;userName:用户名;pageNum:页数;pageSize:每页记录数",
  420. "name": "user",
  421. "in": "body",
  422. "required": true,
  423. "schema": {
  424. "type": "string"
  425. }
  426. }
  427. ],
  428. "responses": {
  429. "200": {
  430. "description": "ok",
  431. "schema": {
  432. "type": "string"
  433. }
  434. }
  435. }
  436. }
  437. },
  438. "/v1/user/login": {
  439. "post": {
  440. "description": "用户登录",
  441. "consumes": [
  442. "application/json"
  443. ],
  444. "produces": [
  445. "application/json"
  446. ],
  447. "tags": [
  448. "用户管理"
  449. ],
  450. "summary": "用户登录",
  451. "parameters": [
  452. {
  453. "description": "username:编号;password:密码;role:角色;",
  454. "name": "user",
  455. "in": "body",
  456. "required": true,
  457. "schema": {
  458. "type": "string"
  459. }
  460. }
  461. ],
  462. "responses": {
  463. "200": {
  464. "description": "ok",
  465. "schema": {
  466. "type": "string"
  467. }
  468. }
  469. }
  470. }
  471. },
  472. "/v1/user/register": {
  473. "post": {
  474. "description": "用户注册",
  475. "consumes": [
  476. "application/json"
  477. ],
  478. "produces": [
  479. "application/json"
  480. ],
  481. "tags": [
  482. "用户管理"
  483. ],
  484. "summary": "用户注册",
  485. "parameters": [
  486. {
  487. "description": "userName:用户名;password:密码;role:角色",
  488. "name": "user",
  489. "in": "body",
  490. "required": true,
  491. "schema": {
  492. "type": "string"
  493. }
  494. }
  495. ],
  496. "responses": {
  497. "200": {
  498. "description": "ok",
  499. "schema": {
  500. "type": "string"
  501. }
  502. }
  503. }
  504. }
  505. },
  506. "/v1/user/reset": {
  507. "post": {
  508. "description": "管理员重置普通用户密码",
  509. "consumes": [
  510. "application/json"
  511. ],
  512. "produces": [
  513. "application/json"
  514. ],
  515. "tags": [
  516. "用户管理"
  517. ],
  518. "summary": "管理员重置普通用户密码",
  519. "parameters": [
  520. {
  521. "description": "username:管理员编号;usernameInit:被重置用户编号",
  522. "name": "user",
  523. "in": "body",
  524. "required": true,
  525. "schema": {
  526. "type": "string"
  527. }
  528. }
  529. ],
  530. "responses": {
  531. "200": {
  532. "description": "ok",
  533. "schema": {
  534. "type": "string"
  535. }
  536. }
  537. }
  538. }
  539. }
  540. }
  541. }