swagger.yaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. gorm.DeletedAt:
  34. properties:
  35. time:
  36. type: string
  37. valid:
  38. description: Valid is true if Time is not NULL
  39. type: boolean
  40. type: object
  41. models.Audio:
  42. properties:
  43. audioStatus:
  44. allOf:
  45. - $ref: '#/definitions/constvar.AudioStatus'
  46. description: 音频状态
  47. createdAt:
  48. type: string
  49. deletedAt:
  50. $ref: '#/definitions/gorm.DeletedAt'
  51. driverNumber:
  52. description: 司机号
  53. type: string
  54. id:
  55. type: integer
  56. isFollowed:
  57. allOf:
  58. - $ref: '#/definitions/constvar.BoolType'
  59. description: 是否关注 1关注 2未关注
  60. locomotiveNumber:
  61. description: 机车号
  62. type: string
  63. name:
  64. description: 音频名称
  65. type: string
  66. occurrenceTime:
  67. type: string
  68. score:
  69. description: 置信度
  70. type: number
  71. size:
  72. description: 音频大小
  73. type: integer
  74. stationNumber:
  75. description: 车站号
  76. type: string
  77. trainNumber:
  78. description: 车次
  79. type: string
  80. updatedAt:
  81. type: string
  82. type: object
  83. models.Text:
  84. properties:
  85. content:
  86. description: 音频名称
  87. type: string
  88. createdAt:
  89. type: string
  90. deletedAt:
  91. $ref: '#/definitions/gorm.DeletedAt'
  92. id:
  93. type: integer
  94. locomotiveNumber:
  95. description: 机车号
  96. type: string
  97. updatedAt:
  98. type: string
  99. type: object
  100. request.AddTextReq:
  101. properties:
  102. content:
  103. description: 音频名称
  104. type: string
  105. locomotiveNumber:
  106. description: 机车号
  107. type: string
  108. required:
  109. - content
  110. - locomotiveNumber
  111. type: object
  112. request.BatchProcessAudio:
  113. properties:
  114. ids:
  115. items:
  116. type: integer
  117. type: array
  118. required:
  119. - ids
  120. type: object
  121. request.FollowReq:
  122. properties:
  123. id:
  124. type: integer
  125. required:
  126. - id
  127. type: object
  128. request.ProcessAudio:
  129. properties:
  130. id:
  131. type: integer
  132. required:
  133. - id
  134. type: object
  135. response.FollowResp:
  136. properties:
  137. followStatus:
  138. $ref: '#/definitions/constvar.BoolType'
  139. type: object
  140. util.Response:
  141. properties:
  142. code:
  143. type: integer
  144. data: {}
  145. msg:
  146. type: string
  147. type: object
  148. util.ResponseList:
  149. properties:
  150. code:
  151. type: integer
  152. data: {}
  153. msg:
  154. type: string
  155. page:
  156. type: integer
  157. pageSize:
  158. type: integer
  159. total:
  160. type: integer
  161. type: object
  162. info:
  163. contact: {}
  164. paths:
  165. /api-sa/v1/audio/batchDelete:
  166. delete:
  167. parameters:
  168. - description: 参数
  169. in: body
  170. name: object
  171. required: true
  172. schema:
  173. $ref: '#/definitions/request.BatchProcessAudio'
  174. produces:
  175. - application/json
  176. responses:
  177. "200":
  178. description: 成功
  179. schema:
  180. $ref: '#/definitions/util.Response'
  181. summary: 批量删除音频
  182. tags:
  183. - 音频
  184. /api-sa/v1/audio/batchProcess:
  185. post:
  186. parameters:
  187. - description: 参数
  188. in: body
  189. name: object
  190. required: true
  191. schema:
  192. $ref: '#/definitions/request.BatchProcessAudio'
  193. produces:
  194. - application/json
  195. responses:
  196. "200":
  197. description: 成功
  198. schema:
  199. $ref: '#/definitions/util.Response'
  200. summary: 批量处理音频
  201. tags:
  202. - 音频
  203. /api-sa/v1/audio/delete:
  204. delete:
  205. parameters:
  206. - description: 参数
  207. in: body
  208. name: object
  209. required: true
  210. schema:
  211. $ref: '#/definitions/request.ProcessAudio'
  212. produces:
  213. - application/json
  214. responses:
  215. "200":
  216. description: 成功
  217. schema:
  218. $ref: '#/definitions/util.Response'
  219. summary: 删除音频
  220. tags:
  221. - 音频
  222. /api-sa/v1/audio/follow:
  223. post:
  224. parameters:
  225. - description: 参数
  226. in: body
  227. name: object
  228. required: true
  229. schema:
  230. $ref: '#/definitions/request.FollowReq'
  231. produces:
  232. - application/json
  233. responses:
  234. "200":
  235. description: 成功
  236. schema:
  237. allOf:
  238. - $ref: '#/definitions/util.Response'
  239. - properties:
  240. data:
  241. $ref: '#/definitions/response.FollowResp'
  242. type: object
  243. summary: 关注/取消关注
  244. tags:
  245. - 音频
  246. /api-sa/v1/audio/list:
  247. get:
  248. parameters:
  249. - description: 司机号
  250. in: query
  251. name: driverNumber
  252. type: string
  253. - description: 关键字
  254. in: query
  255. name: keyword
  256. type: string
  257. - description: 机车号
  258. in: query
  259. name: locomotiveNumber
  260. type: string
  261. - description: 页码
  262. in: query
  263. name: page
  264. type: integer
  265. - description: 每页大小
  266. in: query
  267. name: pageSize
  268. type: integer
  269. - description: 车站号
  270. in: query
  271. name: stationNumber
  272. type: string
  273. - description: 车次
  274. in: query
  275. name: trainNumber
  276. type: string
  277. produces:
  278. - application/json
  279. responses:
  280. "200":
  281. description: 成功
  282. schema:
  283. allOf:
  284. - $ref: '#/definitions/util.ResponseList'
  285. - properties:
  286. data:
  287. items:
  288. $ref: '#/definitions/models.Audio'
  289. type: array
  290. type: object
  291. summary: 音频分析检索
  292. tags:
  293. - 音频
  294. /api-sa/v1/audio/process:
  295. post:
  296. parameters:
  297. - description: 参数
  298. in: body
  299. name: object
  300. required: true
  301. schema:
  302. $ref: '#/definitions/request.ProcessAudio'
  303. produces:
  304. - application/json
  305. responses:
  306. "200":
  307. description: 成功
  308. schema:
  309. $ref: '#/definitions/util.Response'
  310. summary: 处理音频
  311. tags:
  312. - 音频
  313. /api-sa/v1/audio/upload:
  314. post:
  315. parameters:
  316. - description: 音频文件
  317. in: formData
  318. name: file
  319. required: true
  320. type: file
  321. produces:
  322. - application/json
  323. responses:
  324. "200":
  325. description: 成功
  326. schema:
  327. $ref: '#/definitions/util.Response'
  328. summary: 上传音频
  329. tags:
  330. - 音频
  331. /api-sa/v1/text/add:
  332. post:
  333. parameters:
  334. - description: 参数
  335. in: body
  336. name: object
  337. required: true
  338. schema:
  339. $ref: '#/definitions/request.AddTextReq'
  340. produces:
  341. - application/json
  342. responses:
  343. "200":
  344. description: 成功
  345. schema:
  346. $ref: '#/definitions/util.Response'
  347. summary: 新增文字
  348. tags:
  349. - 文字库
  350. /api-sa/v1/text/list:
  351. get:
  352. parameters:
  353. - description: 关键字
  354. in: query
  355. name: keyword
  356. type: string
  357. - description: 页码
  358. in: query
  359. name: page
  360. type: integer
  361. - description: 每页大小
  362. in: query
  363. name: pageSize
  364. type: integer
  365. produces:
  366. - application/json
  367. responses:
  368. "200":
  369. description: 成功
  370. schema:
  371. allOf:
  372. - $ref: '#/definitions/util.ResponseList'
  373. - properties:
  374. data:
  375. items:
  376. $ref: '#/definitions/models.Text'
  377. type: array
  378. type: object
  379. summary: 文字库列表
  380. tags:
  381. - 文字库
  382. swagger: "2.0"