swagger.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. size:
  69. description: 音频大小
  70. type: integer
  71. stationNumber:
  72. description: 车站号
  73. type: string
  74. trainNumber:
  75. description: 车次
  76. type: string
  77. updatedAt:
  78. type: string
  79. type: object
  80. request.ProcessAudio:
  81. properties:
  82. id:
  83. type: integer
  84. required:
  85. - id
  86. type: object
  87. util.Response:
  88. properties:
  89. code:
  90. type: integer
  91. data: {}
  92. msg:
  93. type: string
  94. type: object
  95. util.ResponseList:
  96. properties:
  97. code:
  98. type: integer
  99. data: {}
  100. msg:
  101. type: string
  102. page:
  103. type: integer
  104. pageSize:
  105. type: integer
  106. total:
  107. type: integer
  108. type: object
  109. info:
  110. contact: {}
  111. paths:
  112. /api-sa/v1/audio/list:
  113. get:
  114. parameters:
  115. - description: 司机号
  116. in: query
  117. name: driverNumber
  118. type: string
  119. - description: 关键字
  120. in: query
  121. name: keyword
  122. type: string
  123. - description: 机车号
  124. in: query
  125. name: locomotiveNumber
  126. type: string
  127. - description: 页码
  128. in: query
  129. name: page
  130. type: integer
  131. - description: 每页大小
  132. in: query
  133. name: pageSize
  134. type: integer
  135. - description: 车站号
  136. in: query
  137. name: stationNumber
  138. type: string
  139. - description: 车次
  140. in: query
  141. name: trainNumber
  142. type: string
  143. produces:
  144. - application/json
  145. responses:
  146. "200":
  147. description: 成功
  148. schema:
  149. allOf:
  150. - $ref: '#/definitions/util.ResponseList'
  151. - properties:
  152. data:
  153. items:
  154. $ref: '#/definitions/models.Audio'
  155. type: array
  156. type: object
  157. summary: 音频分析检索
  158. tags:
  159. - 音频
  160. /api-sa/v1/audio/process:
  161. post:
  162. parameters:
  163. - description: 音频信息
  164. in: body
  165. name: object
  166. required: true
  167. schema:
  168. $ref: '#/definitions/request.ProcessAudio'
  169. produces:
  170. - application/json
  171. responses:
  172. "200":
  173. description: 成功
  174. schema:
  175. $ref: '#/definitions/util.Response'
  176. summary: 处理音频
  177. tags:
  178. - 音频
  179. /api-sa/v1/audio/upload:
  180. post:
  181. parameters:
  182. - description: 音频文件
  183. in: formData
  184. name: file
  185. required: true
  186. type: file
  187. produces:
  188. - application/json
  189. responses:
  190. "200":
  191. description: 成功
  192. schema:
  193. $ref: '#/definitions/util.Response'
  194. summary: 上传音频
  195. tags:
  196. - 音频
  197. swagger: "2.0"