swagger.yaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  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/export:
  308. get:
  309. parameters:
  310. - description: 开始时间
  311. in: query
  312. name: beginTime
  313. type: string
  314. - description: 司机号
  315. in: query
  316. name: driverNumber
  317. type: string
  318. - description: 结束时间
  319. in: query
  320. name: endTime
  321. type: string
  322. - description: 是否关注 1关注 2未关注
  323. enum:
  324. - 1
  325. - 2
  326. in: query
  327. name: isFollowed
  328. type: integer
  329. x-enum-comments:
  330. BoolTypeFalse: "false"
  331. BoolTypeTrue: "true"
  332. x-enum-varnames:
  333. - BoolTypeTrue
  334. - BoolTypeFalse
  335. - description: 关键字
  336. in: query
  337. name: keyword
  338. type: string
  339. - description: 机车号
  340. in: query
  341. name: locomotiveNumber
  342. type: string
  343. - description: 页码
  344. in: query
  345. name: page
  346. type: integer
  347. - description: 每页大小
  348. in: query
  349. name: pageSize
  350. type: integer
  351. - description: 车站号
  352. in: query
  353. name: stationNumber
  354. type: string
  355. - collectionFormat: csv
  356. description: 音频状态数组
  357. in: query
  358. items:
  359. enum:
  360. - 0
  361. - 1
  362. - 2
  363. - 3
  364. - 4
  365. type: integer
  366. name: statusList
  367. type: array
  368. - description: 车次
  369. in: query
  370. name: trainNumber
  371. type: string
  372. produces:
  373. - application/json
  374. responses:
  375. "200":
  376. description: 成功
  377. schema:
  378. allOf:
  379. - $ref: '#/definitions/util.ResponseList'
  380. - properties:
  381. data:
  382. items:
  383. $ref: '#/definitions/models.Audio'
  384. type: array
  385. type: object
  386. summary: 音频检索结果到处
  387. tags:
  388. - 音频检索结果到处
  389. /api-sa/v1/audio/follow:
  390. post:
  391. parameters:
  392. - description: 参数
  393. in: body
  394. name: object
  395. required: true
  396. schema:
  397. $ref: '#/definitions/request.FollowReq'
  398. produces:
  399. - application/json
  400. responses:
  401. "200":
  402. description: 成功
  403. schema:
  404. allOf:
  405. - $ref: '#/definitions/util.Response'
  406. - properties:
  407. data:
  408. $ref: '#/definitions/response.FollowResp'
  409. type: object
  410. summary: 关注/取消关注
  411. tags:
  412. - 音频
  413. /api-sa/v1/audio/info:
  414. get:
  415. parameters:
  416. - in: query
  417. name: fileType
  418. type: integer
  419. - in: query
  420. name: id
  421. required: true
  422. type: integer
  423. produces:
  424. - application/json
  425. responses:
  426. "200":
  427. description: 成功
  428. schema:
  429. allOf:
  430. - $ref: '#/definitions/util.Response'
  431. - properties:
  432. data:
  433. $ref: '#/definitions/models.Audio'
  434. type: object
  435. summary: 音频详情,含解析结果
  436. tags:
  437. - 音频
  438. /api-sa/v1/audio/list:
  439. get:
  440. parameters:
  441. - description: 开始时间
  442. in: query
  443. name: beginTime
  444. type: string
  445. - description: 司机号
  446. in: query
  447. name: driverNumber
  448. type: string
  449. - description: 结束时间
  450. in: query
  451. name: endTime
  452. type: string
  453. - description: 是否关注 1关注 2未关注
  454. enum:
  455. - 1
  456. - 2
  457. in: query
  458. name: isFollowed
  459. type: integer
  460. x-enum-comments:
  461. BoolTypeFalse: "false"
  462. BoolTypeTrue: "true"
  463. x-enum-varnames:
  464. - BoolTypeTrue
  465. - BoolTypeFalse
  466. - description: 关键字
  467. in: query
  468. name: keyword
  469. type: string
  470. - description: 机车号
  471. in: query
  472. name: locomotiveNumber
  473. type: string
  474. - description: 页码
  475. in: query
  476. name: page
  477. type: integer
  478. - description: 每页大小
  479. in: query
  480. name: pageSize
  481. type: integer
  482. - description: 车站号
  483. in: query
  484. name: stationNumber
  485. type: string
  486. - collectionFormat: csv
  487. description: 音频状态数组
  488. in: query
  489. items:
  490. enum:
  491. - 0
  492. - 1
  493. - 2
  494. - 3
  495. - 4
  496. type: integer
  497. name: statusList
  498. type: array
  499. - description: 车次
  500. in: query
  501. name: trainNumber
  502. type: string
  503. produces:
  504. - application/json
  505. responses:
  506. "200":
  507. description: 成功
  508. schema:
  509. allOf:
  510. - $ref: '#/definitions/util.ResponseList'
  511. - properties:
  512. data:
  513. items:
  514. $ref: '#/definitions/models.Audio'
  515. type: array
  516. type: object
  517. summary: 音频分析检索
  518. tags:
  519. - 音频
  520. /api-sa/v1/audio/preLoadPath:
  521. get:
  522. produces:
  523. - application/json
  524. responses:
  525. "200":
  526. description: 成功
  527. schema:
  528. allOf:
  529. - $ref: '#/definitions/util.Response'
  530. - properties:
  531. data:
  532. $ref: '#/definitions/response.PreLoadPathResp'
  533. type: object
  534. summary: 音频自动加载路径
  535. tags:
  536. - 音频自动加载路径
  537. /api-sa/v1/audio/process:
  538. post:
  539. parameters:
  540. - description: 参数
  541. in: body
  542. name: object
  543. required: true
  544. schema:
  545. $ref: '#/definitions/request.ProcessAudio'
  546. produces:
  547. - application/json
  548. responses:
  549. "200":
  550. description: 成功
  551. schema:
  552. $ref: '#/definitions/util.Response'
  553. summary: 处理音频
  554. tags:
  555. - 音频
  556. /api-sa/v1/audio/trainInfoList:
  557. get:
  558. parameters:
  559. - description: 信息分类 1机车2车次3车站
  560. enum:
  561. - 1
  562. - 2
  563. - 3
  564. in: query
  565. name: class
  566. type: integer
  567. x-enum-comments:
  568. ClassLocomotive: 机车
  569. ClassStation: 车站
  570. ClassTrain: 车次
  571. x-enum-varnames:
  572. - ClassLocomotive
  573. - ClassTrain
  574. - ClassStation
  575. - description: 页码
  576. in: query
  577. name: page
  578. type: integer
  579. - description: 每页大小
  580. in: query
  581. name: pageSize
  582. type: integer
  583. - description: 上级id
  584. in: query
  585. name: parentID
  586. type: integer
  587. produces:
  588. - application/json
  589. responses:
  590. "200":
  591. description: 成功
  592. schema:
  593. allOf:
  594. - $ref: '#/definitions/util.ResponseList'
  595. - properties:
  596. data:
  597. items:
  598. $ref: '#/definitions/models.TrainInfo'
  599. type: array
  600. type: object
  601. summary: 获取火车信息
  602. tags:
  603. - 音频
  604. /api-sa/v1/audio/upload:
  605. post:
  606. consumes:
  607. - multipart/form-data
  608. parameters:
  609. - collectionFormat: csv
  610. description: 多文件上传
  611. in: formData
  612. items:
  613. type: file
  614. name: file
  615. type: array
  616. produces:
  617. - application/json
  618. responses:
  619. "200":
  620. description: 成功
  621. schema:
  622. $ref: '#/definitions/util.Response'
  623. summary: 上传音频
  624. tags:
  625. - 音频
  626. /api-sa/v1/text/add:
  627. post:
  628. parameters:
  629. - description: 参数
  630. in: body
  631. name: object
  632. required: true
  633. schema:
  634. $ref: '#/definitions/request.AddTextReq'
  635. produces:
  636. - application/json
  637. responses:
  638. "200":
  639. description: 成功
  640. schema:
  641. $ref: '#/definitions/util.Response'
  642. summary: 新增文字
  643. tags:
  644. - 文字库
  645. /api-sa/v1/text/delete:
  646. delete:
  647. parameters:
  648. - description: 参数
  649. in: body
  650. name: object
  651. required: true
  652. schema:
  653. $ref: '#/definitions/request.AddTextReq'
  654. produces:
  655. - application/json
  656. responses:
  657. "200":
  658. description: 成功
  659. schema:
  660. $ref: '#/definitions/util.Response'
  661. summary: 修改文字
  662. tags:
  663. - 文字库
  664. /api-sa/v1/text/list:
  665. get:
  666. parameters:
  667. - description: 关键字
  668. in: query
  669. name: keyword
  670. type: string
  671. - description: 页码
  672. in: query
  673. name: page
  674. type: integer
  675. - description: 每页大小
  676. in: query
  677. name: pageSize
  678. type: integer
  679. produces:
  680. - application/json
  681. responses:
  682. "200":
  683. description: 成功
  684. schema:
  685. allOf:
  686. - $ref: '#/definitions/util.ResponseList'
  687. - properties:
  688. data:
  689. items:
  690. $ref: '#/definitions/models.Word'
  691. type: array
  692. type: object
  693. summary: 文字库列表
  694. tags:
  695. - 文字库
  696. /api-sa/v1/text/update:
  697. post:
  698. parameters:
  699. - description: 参数
  700. in: body
  701. name: object
  702. required: true
  703. schema:
  704. $ref: '#/definitions/request.AddTextReq'
  705. produces:
  706. - application/json
  707. responses:
  708. "200":
  709. description: 成功
  710. schema:
  711. $ref: '#/definitions/util.Response'
  712. summary: 修改文字
  713. tags:
  714. - 文字库
  715. swagger: "2.0"