swagger.yaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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. util.Response:
  196. properties:
  197. code:
  198. type: integer
  199. data: {}
  200. msg:
  201. type: string
  202. type: object
  203. util.ResponseList:
  204. properties:
  205. code:
  206. type: integer
  207. data: {}
  208. msg:
  209. type: string
  210. page:
  211. type: integer
  212. pageSize:
  213. type: integer
  214. total:
  215. type: integer
  216. type: object
  217. info:
  218. contact: {}
  219. paths:
  220. /api-sa/v1/audio/batchDelete:
  221. delete:
  222. parameters:
  223. - description: 参数
  224. in: body
  225. name: object
  226. required: true
  227. schema:
  228. $ref: '#/definitions/request.BatchProcessAudio'
  229. produces:
  230. - application/json
  231. responses:
  232. "200":
  233. description: 成功
  234. schema:
  235. $ref: '#/definitions/util.Response'
  236. summary: 批量删除音频
  237. tags:
  238. - 音频
  239. /api-sa/v1/audio/batchProcess:
  240. post:
  241. parameters:
  242. - description: 参数
  243. in: body
  244. name: object
  245. required: true
  246. schema:
  247. $ref: '#/definitions/request.BatchProcessAudio'
  248. produces:
  249. - application/json
  250. responses:
  251. "200":
  252. description: 成功
  253. schema:
  254. $ref: '#/definitions/util.Response'
  255. summary: 批量处理音频
  256. tags:
  257. - 音频
  258. /api-sa/v1/audio/delete:
  259. delete:
  260. parameters:
  261. - description: 参数
  262. in: body
  263. name: object
  264. required: true
  265. schema:
  266. $ref: '#/definitions/request.ProcessAudio'
  267. produces:
  268. - application/json
  269. responses:
  270. "200":
  271. description: 成功
  272. schema:
  273. $ref: '#/definitions/util.Response'
  274. summary: 删除音频
  275. tags:
  276. - 音频
  277. /api-sa/v1/audio/download:
  278. get:
  279. parameters:
  280. - in: query
  281. name: fileType
  282. type: integer
  283. - in: query
  284. name: id
  285. required: true
  286. type: integer
  287. produces:
  288. - application/json
  289. responses:
  290. "200":
  291. description: 成功
  292. schema:
  293. allOf:
  294. - $ref: '#/definitions/util.Response'
  295. - properties:
  296. data:
  297. $ref: '#/definitions/models.Audio'
  298. type: object
  299. summary: 音频下载
  300. tags:
  301. - 音频
  302. /api-sa/v1/audio/follow:
  303. post:
  304. parameters:
  305. - description: 参数
  306. in: body
  307. name: object
  308. required: true
  309. schema:
  310. $ref: '#/definitions/request.FollowReq'
  311. produces:
  312. - application/json
  313. responses:
  314. "200":
  315. description: 成功
  316. schema:
  317. allOf:
  318. - $ref: '#/definitions/util.Response'
  319. - properties:
  320. data:
  321. $ref: '#/definitions/response.FollowResp'
  322. type: object
  323. summary: 关注/取消关注
  324. tags:
  325. - 音频
  326. /api-sa/v1/audio/info:
  327. get:
  328. parameters:
  329. - in: query
  330. name: fileType
  331. type: integer
  332. - in: query
  333. name: id
  334. required: true
  335. type: integer
  336. produces:
  337. - application/json
  338. responses:
  339. "200":
  340. description: 成功
  341. schema:
  342. allOf:
  343. - $ref: '#/definitions/util.Response'
  344. - properties:
  345. data:
  346. $ref: '#/definitions/models.Audio'
  347. type: object
  348. summary: 音频详情,含解析结果
  349. tags:
  350. - 音频
  351. /api-sa/v1/audio/list:
  352. get:
  353. parameters:
  354. - description: 开始时间
  355. in: query
  356. name: beginTime
  357. type: string
  358. - description: 司机号
  359. in: query
  360. name: driverNumber
  361. type: string
  362. - description: 结束时间
  363. in: query
  364. name: endTime
  365. type: string
  366. - description: 是否关注 1关注 2未关注
  367. enum:
  368. - 1
  369. - 2
  370. in: query
  371. name: isFollowed
  372. type: integer
  373. x-enum-comments:
  374. BoolTypeFalse: "false"
  375. BoolTypeTrue: "true"
  376. x-enum-varnames:
  377. - BoolTypeTrue
  378. - BoolTypeFalse
  379. - description: 关键字
  380. in: query
  381. name: keyword
  382. type: string
  383. - description: 机车号
  384. in: query
  385. name: locomotiveNumber
  386. type: string
  387. - description: 页码
  388. in: query
  389. name: page
  390. type: integer
  391. - description: 每页大小
  392. in: query
  393. name: pageSize
  394. type: integer
  395. - description: 车站号
  396. in: query
  397. name: stationNumber
  398. type: string
  399. - collectionFormat: csv
  400. description: 音频状态数组
  401. in: query
  402. items:
  403. enum:
  404. - 0
  405. - 1
  406. - 2
  407. - 3
  408. - 4
  409. type: integer
  410. name: statusList
  411. type: array
  412. - description: 车次
  413. in: query
  414. name: trainNumber
  415. type: string
  416. produces:
  417. - application/json
  418. responses:
  419. "200":
  420. description: 成功
  421. schema:
  422. allOf:
  423. - $ref: '#/definitions/util.ResponseList'
  424. - properties:
  425. data:
  426. items:
  427. $ref: '#/definitions/models.Audio'
  428. type: array
  429. type: object
  430. summary: 音频分析检索
  431. tags:
  432. - 音频
  433. /api-sa/v1/audio/process:
  434. post:
  435. parameters:
  436. - description: 参数
  437. in: body
  438. name: object
  439. required: true
  440. schema:
  441. $ref: '#/definitions/request.ProcessAudio'
  442. produces:
  443. - application/json
  444. responses:
  445. "200":
  446. description: 成功
  447. schema:
  448. $ref: '#/definitions/util.Response'
  449. summary: 处理音频
  450. tags:
  451. - 音频
  452. /api-sa/v1/audio/trainInfoList:
  453. get:
  454. parameters:
  455. - description: 信息分类 1机车2车次3车站
  456. enum:
  457. - 1
  458. - 2
  459. - 3
  460. in: query
  461. name: class
  462. type: integer
  463. x-enum-comments:
  464. ClassLocomotive: 机车
  465. ClassStation: 车站
  466. ClassTrain: 车次
  467. x-enum-varnames:
  468. - ClassLocomotive
  469. - ClassTrain
  470. - ClassStation
  471. - description: 页码
  472. in: query
  473. name: page
  474. type: integer
  475. - description: 每页大小
  476. in: query
  477. name: pageSize
  478. type: integer
  479. - description: 上级id
  480. in: query
  481. name: parentID
  482. type: integer
  483. produces:
  484. - application/json
  485. responses:
  486. "200":
  487. description: 成功
  488. schema:
  489. allOf:
  490. - $ref: '#/definitions/util.ResponseList'
  491. - properties:
  492. data:
  493. items:
  494. $ref: '#/definitions/models.TrainInfo'
  495. type: array
  496. type: object
  497. summary: 获取火车信息
  498. tags:
  499. - 音频
  500. /api-sa/v1/audio/upload:
  501. post:
  502. consumes:
  503. - multipart/form-data
  504. parameters:
  505. - collectionFormat: csv
  506. description: 多文件上传
  507. in: formData
  508. items:
  509. type: file
  510. name: file
  511. type: array
  512. produces:
  513. - application/json
  514. responses:
  515. "200":
  516. description: 成功
  517. schema:
  518. $ref: '#/definitions/util.Response'
  519. summary: 上传音频
  520. tags:
  521. - 音频
  522. /api-sa/v1/text/add:
  523. post:
  524. parameters:
  525. - description: 参数
  526. in: body
  527. name: object
  528. required: true
  529. schema:
  530. $ref: '#/definitions/request.AddTextReq'
  531. produces:
  532. - application/json
  533. responses:
  534. "200":
  535. description: 成功
  536. schema:
  537. $ref: '#/definitions/util.Response'
  538. summary: 新增文字
  539. tags:
  540. - 文字库
  541. /api-sa/v1/text/delete:
  542. delete:
  543. parameters:
  544. - description: 参数
  545. in: body
  546. name: object
  547. required: true
  548. schema:
  549. $ref: '#/definitions/request.AddTextReq'
  550. produces:
  551. - application/json
  552. responses:
  553. "200":
  554. description: 成功
  555. schema:
  556. $ref: '#/definitions/util.Response'
  557. summary: 修改文字
  558. tags:
  559. - 文字库
  560. /api-sa/v1/text/list:
  561. get:
  562. parameters:
  563. - description: 关键字
  564. in: query
  565. name: keyword
  566. type: string
  567. - description: 页码
  568. in: query
  569. name: page
  570. type: integer
  571. - description: 每页大小
  572. in: query
  573. name: pageSize
  574. type: integer
  575. produces:
  576. - application/json
  577. responses:
  578. "200":
  579. description: 成功
  580. schema:
  581. allOf:
  582. - $ref: '#/definitions/util.ResponseList'
  583. - properties:
  584. data:
  585. items:
  586. $ref: '#/definitions/models.Word'
  587. type: array
  588. type: object
  589. summary: 文字库列表
  590. tags:
  591. - 文字库
  592. /api-sa/v1/text/update:
  593. post:
  594. parameters:
  595. - description: 参数
  596. in: body
  597. name: object
  598. required: true
  599. schema:
  600. $ref: '#/definitions/request.AddTextReq'
  601. produces:
  602. - application/json
  603. responses:
  604. "200":
  605. description: 成功
  606. schema:
  607. $ref: '#/definitions/util.Response'
  608. summary: 修改文字
  609. tags:
  610. - 文字库
  611. swagger: "2.0"