swagger.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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/follow:
  268. post:
  269. parameters:
  270. - description: 参数
  271. in: body
  272. name: object
  273. required: true
  274. schema:
  275. $ref: '#/definitions/request.FollowReq'
  276. produces:
  277. - application/json
  278. responses:
  279. "200":
  280. description: 成功
  281. schema:
  282. allOf:
  283. - $ref: '#/definitions/util.Response'
  284. - properties:
  285. data:
  286. $ref: '#/definitions/response.FollowResp'
  287. type: object
  288. summary: 关注/取消关注
  289. tags:
  290. - 音频
  291. /api-sa/v1/audio/info:
  292. get:
  293. parameters:
  294. - in: query
  295. name: id
  296. required: true
  297. type: integer
  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/models.Audio'
  309. type: object
  310. summary: 音频详情,含解析结果
  311. tags:
  312. - 音频
  313. /api-sa/v1/audio/list:
  314. get:
  315. parameters:
  316. - description: 司机号
  317. in: query
  318. name: driverNumber
  319. type: string
  320. - description: 关键字
  321. in: query
  322. name: keyword
  323. type: string
  324. - description: 机车号
  325. in: query
  326. name: locomotiveNumber
  327. type: string
  328. - description: 页码
  329. in: query
  330. name: page
  331. type: integer
  332. - description: 每页大小
  333. in: query
  334. name: pageSize
  335. type: integer
  336. - description: 车站号
  337. in: query
  338. name: stationNumber
  339. type: string
  340. - description: 车次
  341. in: query
  342. name: trainNumber
  343. type: string
  344. produces:
  345. - application/json
  346. responses:
  347. "200":
  348. description: 成功
  349. schema:
  350. allOf:
  351. - $ref: '#/definitions/util.ResponseList'
  352. - properties:
  353. data:
  354. items:
  355. $ref: '#/definitions/models.Audio'
  356. type: array
  357. type: object
  358. summary: 音频分析检索
  359. tags:
  360. - 音频
  361. /api-sa/v1/audio/process:
  362. post:
  363. parameters:
  364. - description: 参数
  365. in: body
  366. name: object
  367. required: true
  368. schema:
  369. $ref: '#/definitions/request.ProcessAudio'
  370. produces:
  371. - application/json
  372. responses:
  373. "200":
  374. description: 成功
  375. schema:
  376. $ref: '#/definitions/util.Response'
  377. summary: 处理音频
  378. tags:
  379. - 音频
  380. /api-sa/v1/audio/trainInfoList:
  381. get:
  382. parameters:
  383. - description: 信息分类 1机车2车次3车站
  384. enum:
  385. - 1
  386. - 2
  387. - 3
  388. in: query
  389. name: class
  390. type: integer
  391. x-enum-comments:
  392. ClassLocomotive: 机车
  393. ClassStation: 车站
  394. ClassTrain: 车次
  395. x-enum-varnames:
  396. - ClassLocomotive
  397. - ClassTrain
  398. - ClassStation
  399. - description: 页码
  400. in: query
  401. name: page
  402. type: integer
  403. - description: 每页大小
  404. in: query
  405. name: pageSize
  406. type: integer
  407. - description: 上级id
  408. in: query
  409. name: parentID
  410. type: integer
  411. produces:
  412. - application/json
  413. responses:
  414. "200":
  415. description: 成功
  416. schema:
  417. allOf:
  418. - $ref: '#/definitions/util.ResponseList'
  419. - properties:
  420. data:
  421. items:
  422. $ref: '#/definitions/models.TrainInfo'
  423. type: array
  424. type: object
  425. summary: 获取火车信息
  426. tags:
  427. - 音频
  428. /api-sa/v1/audio/upload:
  429. post:
  430. parameters:
  431. - description: 音频文件
  432. in: formData
  433. name: file
  434. required: true
  435. type: file
  436. produces:
  437. - application/json
  438. responses:
  439. "200":
  440. description: 成功
  441. schema:
  442. $ref: '#/definitions/util.Response'
  443. summary: 上传音频
  444. tags:
  445. - 音频
  446. /api-sa/v1/text/add:
  447. post:
  448. parameters:
  449. - description: 参数
  450. in: body
  451. name: object
  452. required: true
  453. schema:
  454. $ref: '#/definitions/request.AddTextReq'
  455. produces:
  456. - application/json
  457. responses:
  458. "200":
  459. description: 成功
  460. schema:
  461. $ref: '#/definitions/util.Response'
  462. summary: 新增文字
  463. tags:
  464. - 文字库
  465. /api-sa/v1/text/list:
  466. get:
  467. parameters:
  468. - description: 关键字
  469. in: query
  470. name: keyword
  471. type: string
  472. - description: 页码
  473. in: query
  474. name: page
  475. type: integer
  476. - description: 每页大小
  477. in: query
  478. name: pageSize
  479. type: integer
  480. produces:
  481. - application/json
  482. responses:
  483. "200":
  484. description: 成功
  485. schema:
  486. allOf:
  487. - $ref: '#/definitions/util.ResponseList'
  488. - properties:
  489. data:
  490. items:
  491. $ref: '#/definitions/models.Word'
  492. type: array
  493. type: object
  494. summary: 文字库列表
  495. tags:
  496. - 文字库
  497. swagger: "2.0"