swagger.yaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  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. kilometerMarker:
  78. description: 公里标
  79. type: string
  80. locomotiveNumber:
  81. description: 机车号
  82. type: string
  83. name:
  84. description: 音频名称
  85. type: string
  86. occurrenceTime:
  87. type: string
  88. routeNumber:
  89. description: 交路号
  90. type: string
  91. score:
  92. description: 置信度
  93. type: number
  94. size:
  95. description: 音频大小
  96. type: integer
  97. station:
  98. description: 车站
  99. type: string
  100. trainNumber:
  101. description: 车次
  102. type: string
  103. updatedAt:
  104. type: string
  105. words:
  106. description: 匹配到的文字数组
  107. items:
  108. type: string
  109. type: array
  110. type: object
  111. models.TrainInfo:
  112. properties:
  113. class:
  114. allOf:
  115. - $ref: '#/definitions/constvar.Class'
  116. description: 分类 1 机车 2车次 3 车站
  117. createdAt:
  118. type: string
  119. deletedAt:
  120. $ref: '#/definitions/gorm.DeletedAt'
  121. id:
  122. type: integer
  123. name:
  124. description: 名称
  125. type: string
  126. parentID:
  127. description: 上级id
  128. type: integer
  129. updatedAt:
  130. type: string
  131. type: object
  132. models.Word:
  133. properties:
  134. content:
  135. description: 文字
  136. type: string
  137. createdAt:
  138. type: string
  139. deletedAt:
  140. $ref: '#/definitions/gorm.DeletedAt'
  141. id:
  142. type: integer
  143. locomotiveNumber:
  144. description: 机车号
  145. type: string
  146. updatedAt:
  147. type: string
  148. type: object
  149. request.AddTextReq:
  150. properties:
  151. content:
  152. description: 音频名称
  153. type: string
  154. id:
  155. type: integer
  156. locomotiveNumber:
  157. description: 机车号
  158. type: string
  159. required:
  160. - content
  161. - locomotiveNumber
  162. type: object
  163. request.BatchProcessAudio:
  164. properties:
  165. ids:
  166. items:
  167. type: integer
  168. type: array
  169. required:
  170. - ids
  171. type: object
  172. request.FollowReq:
  173. properties:
  174. id:
  175. type: integer
  176. required:
  177. - id
  178. type: object
  179. request.ProcessAudio:
  180. properties:
  181. fileType:
  182. type: integer
  183. id:
  184. type: integer
  185. required:
  186. - id
  187. type: object
  188. response.FollowResp:
  189. properties:
  190. followStatus:
  191. allOf:
  192. - $ref: '#/definitions/constvar.BoolType'
  193. description: 1 已关注 2未关注
  194. type: object
  195. response.PreLoadPathResp:
  196. properties:
  197. preLoadPath:
  198. type: string
  199. type: object
  200. util.Response:
  201. properties:
  202. code:
  203. type: integer
  204. data: {}
  205. msg:
  206. type: string
  207. type: object
  208. util.ResponseList:
  209. properties:
  210. code:
  211. type: integer
  212. data: {}
  213. msg:
  214. type: string
  215. page:
  216. type: integer
  217. pageSize:
  218. type: integer
  219. total:
  220. type: integer
  221. type: object
  222. info:
  223. contact: {}
  224. paths:
  225. /api-sa/v1/audio/batchDelete:
  226. delete:
  227. parameters:
  228. - description: 参数
  229. in: body
  230. name: object
  231. required: true
  232. schema:
  233. $ref: '#/definitions/request.BatchProcessAudio'
  234. produces:
  235. - application/json
  236. responses:
  237. "200":
  238. description: 成功
  239. schema:
  240. $ref: '#/definitions/util.Response'
  241. summary: 批量删除音频
  242. tags:
  243. - 音频
  244. /api-sa/v1/audio/batchProcess:
  245. post:
  246. parameters:
  247. - description: 参数
  248. in: body
  249. name: object
  250. required: true
  251. schema:
  252. $ref: '#/definitions/request.BatchProcessAudio'
  253. produces:
  254. - application/json
  255. responses:
  256. "200":
  257. description: 成功
  258. schema:
  259. $ref: '#/definitions/util.Response'
  260. summary: 批量处理音频
  261. tags:
  262. - 音频
  263. /api-sa/v1/audio/delete:
  264. delete:
  265. parameters:
  266. - description: 参数
  267. in: body
  268. name: object
  269. required: true
  270. schema:
  271. $ref: '#/definitions/request.ProcessAudio'
  272. produces:
  273. - application/json
  274. responses:
  275. "200":
  276. description: 成功
  277. schema:
  278. $ref: '#/definitions/util.Response'
  279. summary: 删除音频
  280. tags:
  281. - 音频
  282. /api-sa/v1/audio/download:
  283. get:
  284. parameters:
  285. - in: query
  286. name: fileType
  287. type: integer
  288. - in: query
  289. name: id
  290. required: true
  291. type: integer
  292. produces:
  293. - application/json
  294. responses:
  295. "200":
  296. description: 成功
  297. schema:
  298. allOf:
  299. - $ref: '#/definitions/util.Response'
  300. - properties:
  301. data:
  302. $ref: '#/definitions/models.Audio'
  303. type: object
  304. summary: 音频下载
  305. tags:
  306. - 音频
  307. /api-sa/v1/audio/follow:
  308. post:
  309. parameters:
  310. - description: 参数
  311. in: body
  312. name: object
  313. required: true
  314. schema:
  315. $ref: '#/definitions/request.FollowReq'
  316. produces:
  317. - application/json
  318. responses:
  319. "200":
  320. description: 成功
  321. schema:
  322. allOf:
  323. - $ref: '#/definitions/util.Response'
  324. - properties:
  325. data:
  326. $ref: '#/definitions/response.FollowResp'
  327. type: object
  328. summary: 关注/取消关注
  329. tags:
  330. - 音频
  331. /api-sa/v1/audio/info:
  332. get:
  333. parameters:
  334. - in: query
  335. name: fileType
  336. type: integer
  337. - in: query
  338. name: id
  339. required: true
  340. type: integer
  341. produces:
  342. - application/json
  343. responses:
  344. "200":
  345. description: 成功
  346. schema:
  347. allOf:
  348. - $ref: '#/definitions/util.Response'
  349. - properties:
  350. data:
  351. $ref: '#/definitions/models.Audio'
  352. type: object
  353. summary: 音频详情,含解析结果
  354. tags:
  355. - 音频
  356. /api-sa/v1/audio/list:
  357. get:
  358. parameters:
  359. - description: 开始时间
  360. in: query
  361. name: beginTime
  362. type: string
  363. - description: 司机号
  364. in: query
  365. name: driverNumber
  366. type: string
  367. - description: 结束时间
  368. in: query
  369. name: endTime
  370. type: string
  371. - description: 是否关注 1关注 2未关注
  372. enum:
  373. - 1
  374. - 2
  375. in: query
  376. name: isFollowed
  377. type: integer
  378. x-enum-comments:
  379. BoolTypeFalse: "false"
  380. BoolTypeTrue: "true"
  381. x-enum-varnames:
  382. - BoolTypeTrue
  383. - BoolTypeFalse
  384. - description: 关键字
  385. in: query
  386. name: keyword
  387. type: string
  388. - description: 机车号
  389. in: query
  390. name: locomotiveNumber
  391. type: string
  392. - description: 页码
  393. in: query
  394. name: page
  395. type: integer
  396. - description: 每页大小
  397. in: query
  398. name: pageSize
  399. type: integer
  400. - description: 车站号
  401. in: query
  402. name: stationNumber
  403. type: string
  404. - collectionFormat: csv
  405. description: 音频状态数组
  406. in: query
  407. items:
  408. enum:
  409. - 0
  410. - 1
  411. - 2
  412. - 3
  413. - 4
  414. type: integer
  415. name: statusList
  416. type: array
  417. - description: 车次
  418. in: query
  419. name: trainNumber
  420. type: string
  421. produces:
  422. - application/json
  423. responses:
  424. "200":
  425. description: 成功
  426. schema:
  427. allOf:
  428. - $ref: '#/definitions/util.ResponseList'
  429. - properties:
  430. data:
  431. items:
  432. $ref: '#/definitions/models.Audio'
  433. type: array
  434. type: object
  435. summary: 音频分析检索
  436. tags:
  437. - 音频
  438. /api-sa/v1/audio/preLoadPath:
  439. get:
  440. produces:
  441. - application/json
  442. responses:
  443. "200":
  444. description: 成功
  445. schema:
  446. allOf:
  447. - $ref: '#/definitions/util.Response'
  448. - properties:
  449. data:
  450. $ref: '#/definitions/response.PreLoadPathResp'
  451. type: object
  452. summary: 音频自动加载路径
  453. tags:
  454. - 音频自动加载路径
  455. /api-sa/v1/audio/process:
  456. post:
  457. parameters:
  458. - description: 参数
  459. in: body
  460. name: object
  461. required: true
  462. schema:
  463. $ref: '#/definitions/request.ProcessAudio'
  464. produces:
  465. - application/json
  466. responses:
  467. "200":
  468. description: 成功
  469. schema:
  470. $ref: '#/definitions/util.Response'
  471. summary: 处理音频
  472. tags:
  473. - 音频
  474. /api-sa/v1/audio/trainInfoList:
  475. get:
  476. parameters:
  477. - description: 信息分类 1机车2车次3车站
  478. enum:
  479. - 1
  480. - 2
  481. - 3
  482. in: query
  483. name: class
  484. type: integer
  485. x-enum-comments:
  486. ClassLocomotive: 机车
  487. ClassStation: 车站
  488. ClassTrain: 车次
  489. x-enum-varnames:
  490. - ClassLocomotive
  491. - ClassTrain
  492. - ClassStation
  493. - description: 页码
  494. in: query
  495. name: page
  496. type: integer
  497. - description: 每页大小
  498. in: query
  499. name: pageSize
  500. type: integer
  501. - description: 上级id
  502. in: query
  503. name: parentID
  504. type: integer
  505. produces:
  506. - application/json
  507. responses:
  508. "200":
  509. description: 成功
  510. schema:
  511. allOf:
  512. - $ref: '#/definitions/util.ResponseList'
  513. - properties:
  514. data:
  515. items:
  516. $ref: '#/definitions/models.TrainInfo'
  517. type: array
  518. type: object
  519. summary: 获取火车信息
  520. tags:
  521. - 音频
  522. /api-sa/v1/audio/upload:
  523. post:
  524. consumes:
  525. - multipart/form-data
  526. parameters:
  527. - collectionFormat: csv
  528. description: 多文件上传
  529. in: formData
  530. items:
  531. type: file
  532. name: file
  533. type: array
  534. produces:
  535. - application/json
  536. responses:
  537. "200":
  538. description: 成功
  539. schema:
  540. $ref: '#/definitions/util.Response'
  541. summary: 上传音频
  542. tags:
  543. - 音频
  544. /api-sa/v1/text/add:
  545. post:
  546. parameters:
  547. - description: 参数
  548. in: body
  549. name: object
  550. required: true
  551. schema:
  552. $ref: '#/definitions/request.AddTextReq'
  553. produces:
  554. - application/json
  555. responses:
  556. "200":
  557. description: 成功
  558. schema:
  559. $ref: '#/definitions/util.Response'
  560. summary: 新增文字
  561. tags:
  562. - 文字库
  563. /api-sa/v1/text/delete:
  564. delete:
  565. parameters:
  566. - description: 参数
  567. in: body
  568. name: object
  569. required: true
  570. schema:
  571. $ref: '#/definitions/request.AddTextReq'
  572. produces:
  573. - application/json
  574. responses:
  575. "200":
  576. description: 成功
  577. schema:
  578. $ref: '#/definitions/util.Response'
  579. summary: 修改文字
  580. tags:
  581. - 文字库
  582. /api-sa/v1/text/list:
  583. get:
  584. parameters:
  585. - description: 关键字
  586. in: query
  587. name: keyword
  588. type: string
  589. - description: 页码
  590. in: query
  591. name: page
  592. type: integer
  593. - description: 每页大小
  594. in: query
  595. name: pageSize
  596. type: integer
  597. produces:
  598. - application/json
  599. responses:
  600. "200":
  601. description: 成功
  602. schema:
  603. allOf:
  604. - $ref: '#/definitions/util.ResponseList'
  605. - properties:
  606. data:
  607. items:
  608. $ref: '#/definitions/models.Word'
  609. type: array
  610. type: object
  611. summary: 文字库列表
  612. tags:
  613. - 文字库
  614. /api-sa/v1/text/update:
  615. post:
  616. parameters:
  617. - description: 参数
  618. in: body
  619. name: object
  620. required: true
  621. schema:
  622. $ref: '#/definitions/request.AddTextReq'
  623. produces:
  624. - application/json
  625. responses:
  626. "200":
  627. description: 成功
  628. schema:
  629. $ref: '#/definitions/util.Response'
  630. summary: 修改文字
  631. tags:
  632. - 文字库
  633. swagger: "2.0"