swagger.yaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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. createdAt:
  62. type: string
  63. deletedAt:
  64. $ref: '#/definitions/gorm.DeletedAt'
  65. driverNumber:
  66. description: 司机号
  67. type: string
  68. id:
  69. type: integer
  70. isFollowed:
  71. allOf:
  72. - $ref: '#/definitions/constvar.BoolType'
  73. description: 是否关注 1关注 2未关注
  74. locomotiveNumber:
  75. description: 机车号
  76. type: string
  77. name:
  78. description: 音频名称
  79. type: string
  80. occurrenceTime:
  81. type: string
  82. score:
  83. description: 置信度
  84. type: number
  85. size:
  86. description: 音频大小
  87. type: integer
  88. station:
  89. description: 车站
  90. type: string
  91. trainNumber:
  92. description: 车次
  93. type: string
  94. updatedAt:
  95. type: string
  96. type: object
  97. models.Text:
  98. properties:
  99. content:
  100. description: 音频名称
  101. type: string
  102. createdAt:
  103. type: string
  104. deletedAt:
  105. $ref: '#/definitions/gorm.DeletedAt'
  106. id:
  107. type: integer
  108. locomotiveNumber:
  109. description: 机车号
  110. type: string
  111. updatedAt:
  112. type: string
  113. type: object
  114. models.TrainInfo:
  115. properties:
  116. class:
  117. allOf:
  118. - $ref: '#/definitions/constvar.Class'
  119. description: 分类
  120. createdAt:
  121. type: string
  122. deletedAt:
  123. $ref: '#/definitions/gorm.DeletedAt'
  124. id:
  125. type: integer
  126. name:
  127. description: 名称
  128. type: string
  129. parentID:
  130. description: 上级id
  131. type: integer
  132. updatedAt:
  133. type: string
  134. type: object
  135. request.AddTextReq:
  136. properties:
  137. content:
  138. description: 音频名称
  139. type: string
  140. locomotiveNumber:
  141. description: 机车号
  142. type: string
  143. required:
  144. - content
  145. - locomotiveNumber
  146. type: object
  147. request.BatchProcessAudio:
  148. properties:
  149. ids:
  150. items:
  151. type: integer
  152. type: array
  153. required:
  154. - ids
  155. type: object
  156. request.FollowReq:
  157. properties:
  158. id:
  159. type: integer
  160. required:
  161. - id
  162. type: object
  163. request.ProcessAudio:
  164. properties:
  165. id:
  166. type: integer
  167. required:
  168. - id
  169. type: object
  170. response.FollowResp:
  171. properties:
  172. followStatus:
  173. $ref: '#/definitions/constvar.BoolType'
  174. type: object
  175. util.Response:
  176. properties:
  177. code:
  178. type: integer
  179. data: {}
  180. msg:
  181. type: string
  182. type: object
  183. util.ResponseList:
  184. properties:
  185. code:
  186. type: integer
  187. data: {}
  188. msg:
  189. type: string
  190. page:
  191. type: integer
  192. pageSize:
  193. type: integer
  194. total:
  195. type: integer
  196. type: object
  197. info:
  198. contact: {}
  199. paths:
  200. /api-sa/v1/audio/batchDelete:
  201. delete:
  202. parameters:
  203. - description: 参数
  204. in: body
  205. name: object
  206. required: true
  207. schema:
  208. $ref: '#/definitions/request.BatchProcessAudio'
  209. produces:
  210. - application/json
  211. responses:
  212. "200":
  213. description: 成功
  214. schema:
  215. $ref: '#/definitions/util.Response'
  216. summary: 批量删除音频
  217. tags:
  218. - 音频
  219. /api-sa/v1/audio/batchProcess:
  220. post:
  221. parameters:
  222. - description: 参数
  223. in: body
  224. name: object
  225. required: true
  226. schema:
  227. $ref: '#/definitions/request.BatchProcessAudio'
  228. produces:
  229. - application/json
  230. responses:
  231. "200":
  232. description: 成功
  233. schema:
  234. $ref: '#/definitions/util.Response'
  235. summary: 批量处理音频
  236. tags:
  237. - 音频
  238. /api-sa/v1/audio/delete:
  239. delete:
  240. parameters:
  241. - description: 参数
  242. in: body
  243. name: object
  244. required: true
  245. schema:
  246. $ref: '#/definitions/request.ProcessAudio'
  247. produces:
  248. - application/json
  249. responses:
  250. "200":
  251. description: 成功
  252. schema:
  253. $ref: '#/definitions/util.Response'
  254. summary: 删除音频
  255. tags:
  256. - 音频
  257. /api-sa/v1/audio/follow:
  258. post:
  259. parameters:
  260. - description: 参数
  261. in: body
  262. name: object
  263. required: true
  264. schema:
  265. $ref: '#/definitions/request.FollowReq'
  266. produces:
  267. - application/json
  268. responses:
  269. "200":
  270. description: 成功
  271. schema:
  272. allOf:
  273. - $ref: '#/definitions/util.Response'
  274. - properties:
  275. data:
  276. $ref: '#/definitions/response.FollowResp'
  277. type: object
  278. summary: 关注/取消关注
  279. tags:
  280. - 音频
  281. /api-sa/v1/audio/list:
  282. get:
  283. parameters:
  284. - description: 司机号
  285. in: query
  286. name: driverNumber
  287. type: string
  288. - description: 关键字
  289. in: query
  290. name: keyword
  291. type: string
  292. - description: 机车号
  293. in: query
  294. name: locomotiveNumber
  295. type: string
  296. - description: 页码
  297. in: query
  298. name: page
  299. type: integer
  300. - description: 每页大小
  301. in: query
  302. name: pageSize
  303. type: integer
  304. - description: 车站号
  305. in: query
  306. name: stationNumber
  307. type: string
  308. - description: 车次
  309. in: query
  310. name: trainNumber
  311. type: string
  312. produces:
  313. - application/json
  314. responses:
  315. "200":
  316. description: 成功
  317. schema:
  318. allOf:
  319. - $ref: '#/definitions/util.ResponseList'
  320. - properties:
  321. data:
  322. items:
  323. $ref: '#/definitions/models.Audio'
  324. type: array
  325. type: object
  326. summary: 音频分析检索
  327. tags:
  328. - 音频
  329. /api-sa/v1/audio/process:
  330. post:
  331. parameters:
  332. - description: 参数
  333. in: body
  334. name: object
  335. required: true
  336. schema:
  337. $ref: '#/definitions/request.ProcessAudio'
  338. produces:
  339. - application/json
  340. responses:
  341. "200":
  342. description: 成功
  343. schema:
  344. $ref: '#/definitions/util.Response'
  345. summary: 处理音频
  346. tags:
  347. - 音频
  348. /api-sa/v1/audio/trainInfoList:
  349. get:
  350. parameters:
  351. - description: 信息分类 1机车2车次3车站
  352. enum:
  353. - 1
  354. - 2
  355. - 3
  356. in: query
  357. name: class
  358. type: integer
  359. x-enum-comments:
  360. ClassLocomotive: 机车
  361. ClassStation: 车站
  362. ClassTrain: 车次
  363. x-enum-varnames:
  364. - ClassLocomotive
  365. - ClassTrain
  366. - ClassStation
  367. - description: 页码
  368. in: query
  369. name: page
  370. type: integer
  371. - description: 每页大小
  372. in: query
  373. name: pageSize
  374. type: integer
  375. - description: 上级id
  376. in: query
  377. name: parentID
  378. type: integer
  379. produces:
  380. - application/json
  381. responses:
  382. "200":
  383. description: 成功
  384. schema:
  385. allOf:
  386. - $ref: '#/definitions/util.ResponseList'
  387. - properties:
  388. data:
  389. items:
  390. $ref: '#/definitions/models.TrainInfo'
  391. type: array
  392. type: object
  393. summary: 获取火车信息
  394. tags:
  395. - 音频
  396. /api-sa/v1/audio/upload:
  397. post:
  398. parameters:
  399. - description: 音频文件
  400. in: formData
  401. name: file
  402. required: true
  403. type: file
  404. produces:
  405. - application/json
  406. responses:
  407. "200":
  408. description: 成功
  409. schema:
  410. $ref: '#/definitions/util.Response'
  411. summary: 上传音频
  412. tags:
  413. - 音频
  414. /api-sa/v1/text/add:
  415. post:
  416. parameters:
  417. - description: 参数
  418. in: body
  419. name: object
  420. required: true
  421. schema:
  422. $ref: '#/definitions/request.AddTextReq'
  423. produces:
  424. - application/json
  425. responses:
  426. "200":
  427. description: 成功
  428. schema:
  429. $ref: '#/definitions/util.Response'
  430. summary: 新增文字
  431. tags:
  432. - 文字库
  433. /api-sa/v1/text/list:
  434. get:
  435. parameters:
  436. - description: 关键字
  437. in: query
  438. name: keyword
  439. type: string
  440. - description: 页码
  441. in: query
  442. name: page
  443. type: integer
  444. - description: 每页大小
  445. in: query
  446. name: pageSize
  447. type: integer
  448. produces:
  449. - application/json
  450. responses:
  451. "200":
  452. description: 成功
  453. schema:
  454. allOf:
  455. - $ref: '#/definitions/util.ResponseList'
  456. - properties:
  457. data:
  458. items:
  459. $ref: '#/definitions/models.Text'
  460. type: array
  461. type: object
  462. summary: 文字库列表
  463. tags:
  464. - 文字库
  465. swagger: "2.0"