swagger.yaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. definitions:
  2. constvar.AudioStatus:
  3. enum:
  4. - 0
  5. - 1
  6. - 2
  7. - 3
  8. - 4
  9. type: integer
  10. x-enum-comments:
  11. AudioStatusFailed: 处理失败
  12. AudioStatusFinish: 处理完成
  13. AudioStatusProcessing: 处理中
  14. AudioStatusUploadOk: 上传成功 待处理
  15. AudioStatusUploading: 上传中
  16. x-enum-varnames:
  17. - AudioStatusUploading
  18. - AudioStatusUploadOk
  19. - AudioStatusProcessing
  20. - AudioStatusFinish
  21. - AudioStatusFailed
  22. constvar.BoolType:
  23. enum:
  24. - 1
  25. - 2
  26. type: integer
  27. x-enum-comments:
  28. BoolTypeFalse: "false"
  29. BoolTypeTrue: "true"
  30. x-enum-varnames:
  31. - BoolTypeTrue
  32. - BoolTypeFalse
  33. constvar.Class:
  34. enum:
  35. - 1
  36. - 2
  37. - 3
  38. type: integer
  39. x-enum-comments:
  40. ClassLocomotive: 机车
  41. ClassStation: 车站
  42. ClassTrain: 车次
  43. x-enum-varnames:
  44. - ClassLocomotive
  45. - ClassTrain
  46. - ClassStation
  47. gorm.DeletedAt:
  48. properties:
  49. time:
  50. type: string
  51. valid:
  52. description: Valid is true if Time is not NULL
  53. type: boolean
  54. type: object
  55. models.Audio:
  56. properties:
  57. audioStatus:
  58. allOf:
  59. - $ref: '#/definitions/constvar.AudioStatus'
  60. description: 音频状态
  61. audioText:
  62. description: 解析出的文本
  63. type: string
  64. createdAt:
  65. type: string
  66. deletedAt:
  67. $ref: '#/definitions/gorm.DeletedAt'
  68. driverNumber:
  69. description: 司机号
  70. type: string
  71. id:
  72. type: integer
  73. isFollowed:
  74. allOf:
  75. - $ref: '#/definitions/constvar.BoolType'
  76. description: 是否关注 1关注 2未关注
  77. locomotiveNumber:
  78. description: 机车号
  79. type: string
  80. name:
  81. description: 音频名称
  82. type: string
  83. occurrenceTime:
  84. type: string
  85. score:
  86. description: 置信度
  87. type: number
  88. size:
  89. description: 音频大小
  90. type: integer
  91. station:
  92. description: 车站
  93. type: string
  94. trainNumber:
  95. description: 车次
  96. type: string
  97. updatedAt:
  98. type: string
  99. words:
  100. description: 匹配到的文字数组
  101. items:
  102. type: string
  103. type: array
  104. type: object
  105. models.TrainInfo:
  106. properties:
  107. class:
  108. allOf:
  109. - $ref: '#/definitions/constvar.Class'
  110. description: 分类 1 机车 2车次 3 车站
  111. createdAt:
  112. type: string
  113. deletedAt:
  114. $ref: '#/definitions/gorm.DeletedAt'
  115. id:
  116. type: integer
  117. name:
  118. description: 名称
  119. type: string
  120. parentID:
  121. description: 上级id
  122. type: integer
  123. updatedAt:
  124. type: string
  125. type: object
  126. models.Word:
  127. properties:
  128. content:
  129. description: 文字
  130. type: string
  131. createdAt:
  132. type: string
  133. deletedAt:
  134. $ref: '#/definitions/gorm.DeletedAt'
  135. id:
  136. type: integer
  137. locomotiveNumber:
  138. description: 机车号
  139. type: string
  140. updatedAt:
  141. type: string
  142. type: object
  143. request.AddTextReq:
  144. properties:
  145. content:
  146. description: 音频名称
  147. type: string
  148. locomotiveNumber:
  149. description: 机车号
  150. type: string
  151. required:
  152. - content
  153. - locomotiveNumber
  154. type: object
  155. request.BatchProcessAudio:
  156. properties:
  157. ids:
  158. items:
  159. type: integer
  160. type: array
  161. required:
  162. - ids
  163. type: object
  164. request.FollowReq:
  165. properties:
  166. id:
  167. type: integer
  168. required:
  169. - id
  170. type: object
  171. request.ProcessAudio:
  172. properties:
  173. id:
  174. type: integer
  175. required:
  176. - id
  177. type: object
  178. response.FollowResp:
  179. properties:
  180. followStatus:
  181. allOf:
  182. - $ref: '#/definitions/constvar.BoolType'
  183. description: 1 已关注 2未关注
  184. type: object
  185. util.Response:
  186. properties:
  187. code:
  188. type: integer
  189. data: {}
  190. msg:
  191. type: string
  192. type: object
  193. util.ResponseList:
  194. properties:
  195. code:
  196. type: integer
  197. data: {}
  198. msg:
  199. type: string
  200. page:
  201. type: integer
  202. pageSize:
  203. type: integer
  204. total:
  205. type: integer
  206. type: object
  207. info:
  208. contact: {}
  209. paths:
  210. /api-sa/v1/audio/batchDelete:
  211. delete:
  212. parameters:
  213. - description: 参数
  214. in: body
  215. name: object
  216. required: true
  217. schema:
  218. $ref: '#/definitions/request.BatchProcessAudio'
  219. produces:
  220. - application/json
  221. responses:
  222. "200":
  223. description: 成功
  224. schema:
  225. $ref: '#/definitions/util.Response'
  226. summary: 批量删除音频
  227. tags:
  228. - 音频
  229. /api-sa/v1/audio/batchProcess:
  230. post:
  231. parameters:
  232. - description: 参数
  233. in: body
  234. name: object
  235. required: true
  236. schema:
  237. $ref: '#/definitions/request.BatchProcessAudio'
  238. produces:
  239. - application/json
  240. responses:
  241. "200":
  242. description: 成功
  243. schema:
  244. $ref: '#/definitions/util.Response'
  245. summary: 批量处理音频
  246. tags:
  247. - 音频
  248. /api-sa/v1/audio/delete:
  249. delete:
  250. parameters:
  251. - description: 参数
  252. in: body
  253. name: object
  254. required: true
  255. schema:
  256. $ref: '#/definitions/request.ProcessAudio'
  257. produces:
  258. - application/json
  259. responses:
  260. "200":
  261. description: 成功
  262. schema:
  263. $ref: '#/definitions/util.Response'
  264. summary: 删除音频
  265. tags:
  266. - 音频
  267. /api-sa/v1/audio/download:
  268. get:
  269. parameters:
  270. - in: query
  271. name: id
  272. required: true
  273. type: integer
  274. produces:
  275. - application/json
  276. responses:
  277. "200":
  278. description: 成功
  279. schema:
  280. allOf:
  281. - $ref: '#/definitions/util.Response'
  282. - properties:
  283. data:
  284. $ref: '#/definitions/models.Audio'
  285. type: object
  286. summary: 音频下载
  287. tags:
  288. - 音频
  289. /api-sa/v1/audio/follow:
  290. post:
  291. parameters:
  292. - description: 参数
  293. in: body
  294. name: object
  295. required: true
  296. schema:
  297. $ref: '#/definitions/request.FollowReq'
  298. produces:
  299. - application/json
  300. responses:
  301. "200":
  302. description: 成功
  303. schema:
  304. allOf:
  305. - $ref: '#/definitions/util.Response'
  306. - properties:
  307. data:
  308. $ref: '#/definitions/response.FollowResp'
  309. type: object
  310. summary: 关注/取消关注
  311. tags:
  312. - 音频
  313. /api-sa/v1/audio/info:
  314. get:
  315. parameters:
  316. - in: query
  317. name: id
  318. required: true
  319. type: integer
  320. produces:
  321. - application/json
  322. responses:
  323. "200":
  324. description: 成功
  325. schema:
  326. allOf:
  327. - $ref: '#/definitions/util.Response'
  328. - properties:
  329. data:
  330. $ref: '#/definitions/models.Audio'
  331. type: object
  332. summary: 音频详情,含解析结果
  333. tags:
  334. - 音频
  335. /api-sa/v1/audio/list:
  336. get:
  337. parameters:
  338. - description: 开始时间
  339. in: query
  340. name: beginTime
  341. type: string
  342. - description: 司机号
  343. in: query
  344. name: driverNumber
  345. type: string
  346. - description: 结束时间
  347. in: query
  348. name: endTime
  349. type: string
  350. - description: 是否关注 1关注 2未关注
  351. enum:
  352. - 1
  353. - 2
  354. in: query
  355. name: isFollowed
  356. type: integer
  357. x-enum-comments:
  358. BoolTypeFalse: "false"
  359. BoolTypeTrue: "true"
  360. x-enum-varnames:
  361. - BoolTypeTrue
  362. - BoolTypeFalse
  363. - description: 关键字
  364. in: query
  365. name: keyword
  366. type: string
  367. - description: 机车号
  368. in: query
  369. name: locomotiveNumber
  370. type: string
  371. - description: 页码
  372. in: query
  373. name: page
  374. type: integer
  375. - description: 每页大小
  376. in: query
  377. name: pageSize
  378. type: integer
  379. - description: 车站号
  380. in: query
  381. name: stationNumber
  382. type: string
  383. - collectionFormat: csv
  384. description: 音频状态数组
  385. in: query
  386. items:
  387. enum:
  388. - 0
  389. - 1
  390. - 2
  391. - 3
  392. - 4
  393. type: integer
  394. name: statusList
  395. type: array
  396. - description: 车次
  397. in: query
  398. name: trainNumber
  399. type: string
  400. produces:
  401. - application/json
  402. responses:
  403. "200":
  404. description: 成功
  405. schema:
  406. allOf:
  407. - $ref: '#/definitions/util.ResponseList'
  408. - properties:
  409. data:
  410. items:
  411. $ref: '#/definitions/models.Audio'
  412. type: array
  413. type: object
  414. summary: 音频分析检索
  415. tags:
  416. - 音频
  417. /api-sa/v1/audio/process:
  418. post:
  419. parameters:
  420. - description: 参数
  421. in: body
  422. name: object
  423. required: true
  424. schema:
  425. $ref: '#/definitions/request.ProcessAudio'
  426. produces:
  427. - application/json
  428. responses:
  429. "200":
  430. description: 成功
  431. schema:
  432. $ref: '#/definitions/util.Response'
  433. summary: 处理音频
  434. tags:
  435. - 音频
  436. /api-sa/v1/audio/trainInfoList:
  437. get:
  438. parameters:
  439. - description: 信息分类 1机车2车次3车站
  440. enum:
  441. - 1
  442. - 2
  443. - 3
  444. in: query
  445. name: class
  446. type: integer
  447. x-enum-comments:
  448. ClassLocomotive: 机车
  449. ClassStation: 车站
  450. ClassTrain: 车次
  451. x-enum-varnames:
  452. - ClassLocomotive
  453. - ClassTrain
  454. - ClassStation
  455. - description: 页码
  456. in: query
  457. name: page
  458. type: integer
  459. - description: 每页大小
  460. in: query
  461. name: pageSize
  462. type: integer
  463. - description: 上级id
  464. in: query
  465. name: parentID
  466. type: integer
  467. produces:
  468. - application/json
  469. responses:
  470. "200":
  471. description: 成功
  472. schema:
  473. allOf:
  474. - $ref: '#/definitions/util.ResponseList'
  475. - properties:
  476. data:
  477. items:
  478. $ref: '#/definitions/models.TrainInfo'
  479. type: array
  480. type: object
  481. summary: 获取火车信息
  482. tags:
  483. - 音频
  484. /api-sa/v1/audio/upload:
  485. post:
  486. parameters:
  487. - description: 音频文件
  488. in: formData
  489. name: file
  490. type: file
  491. - collectionFormat: csv
  492. description: 多个音频文件
  493. in: formData
  494. items:
  495. type: file
  496. name: files
  497. type: array
  498. produces:
  499. - application/json
  500. responses:
  501. "200":
  502. description: 成功
  503. schema:
  504. $ref: '#/definitions/util.Response'
  505. summary: 上传音频
  506. tags:
  507. - 音频
  508. /api-sa/v1/text/add:
  509. post:
  510. parameters:
  511. - description: 参数
  512. in: body
  513. name: object
  514. required: true
  515. schema:
  516. $ref: '#/definitions/request.AddTextReq'
  517. produces:
  518. - application/json
  519. responses:
  520. "200":
  521. description: 成功
  522. schema:
  523. $ref: '#/definitions/util.Response'
  524. summary: 新增文字
  525. tags:
  526. - 文字库
  527. /api-sa/v1/text/list:
  528. get:
  529. parameters:
  530. - description: 关键字
  531. in: query
  532. name: keyword
  533. type: string
  534. - description: 页码
  535. in: query
  536. name: page
  537. type: integer
  538. - description: 每页大小
  539. in: query
  540. name: pageSize
  541. type: integer
  542. produces:
  543. - application/json
  544. responses:
  545. "200":
  546. description: 成功
  547. schema:
  548. allOf:
  549. - $ref: '#/definitions/util.ResponseList'
  550. - properties:
  551. data:
  552. items:
  553. $ref: '#/definitions/models.Word'
  554. type: array
  555. type: object
  556. summary: 文字库列表
  557. tags:
  558. - 文字库
  559. swagger: "2.0"