swagger.json 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "contact": {}
  5. },
  6. "paths": {
  7. "/api-sa/v1/audio/list": {
  8. "get": {
  9. "produces": [
  10. "application/json"
  11. ],
  12. "tags": [
  13. "音频"
  14. ],
  15. "summary": "音频分析检索",
  16. "parameters": [
  17. {
  18. "type": "string",
  19. "description": "司机号",
  20. "name": "driverNumber",
  21. "in": "query"
  22. },
  23. {
  24. "type": "string",
  25. "description": "关键字",
  26. "name": "keyword",
  27. "in": "query"
  28. },
  29. {
  30. "type": "string",
  31. "description": "机车号",
  32. "name": "locomotiveNumber",
  33. "in": "query"
  34. },
  35. {
  36. "type": "integer",
  37. "description": "页码",
  38. "name": "page",
  39. "in": "query"
  40. },
  41. {
  42. "type": "integer",
  43. "description": "每页大小",
  44. "name": "pageSize",
  45. "in": "query"
  46. },
  47. {
  48. "type": "string",
  49. "description": "车站号",
  50. "name": "stationNumber",
  51. "in": "query"
  52. },
  53. {
  54. "type": "string",
  55. "description": "车次",
  56. "name": "trainNumber",
  57. "in": "query"
  58. }
  59. ],
  60. "responses": {
  61. "200": {
  62. "description": "成功",
  63. "schema": {
  64. "allOf": [
  65. {
  66. "$ref": "#/definitions/util.ResponseList"
  67. },
  68. {
  69. "type": "object",
  70. "properties": {
  71. "data": {
  72. "type": "array",
  73. "items": {
  74. "$ref": "#/definitions/models.Audio"
  75. }
  76. }
  77. }
  78. }
  79. ]
  80. }
  81. }
  82. }
  83. }
  84. },
  85. "/api-sa/v1/audio/process": {
  86. "post": {
  87. "produces": [
  88. "application/json"
  89. ],
  90. "tags": [
  91. "音频"
  92. ],
  93. "summary": "处理音频",
  94. "parameters": [
  95. {
  96. "description": "音频信息",
  97. "name": "object",
  98. "in": "body",
  99. "required": true,
  100. "schema": {
  101. "$ref": "#/definitions/request.ProcessAudio"
  102. }
  103. }
  104. ],
  105. "responses": {
  106. "200": {
  107. "description": "成功",
  108. "schema": {
  109. "$ref": "#/definitions/util.Response"
  110. }
  111. }
  112. }
  113. }
  114. },
  115. "/api-sa/v1/audio/upload": {
  116. "post": {
  117. "produces": [
  118. "application/json"
  119. ],
  120. "tags": [
  121. "音频"
  122. ],
  123. "summary": "上传音频",
  124. "parameters": [
  125. {
  126. "type": "file",
  127. "description": "音频文件",
  128. "name": "file",
  129. "in": "formData",
  130. "required": true
  131. }
  132. ],
  133. "responses": {
  134. "200": {
  135. "description": "成功",
  136. "schema": {
  137. "$ref": "#/definitions/util.Response"
  138. }
  139. }
  140. }
  141. }
  142. }
  143. },
  144. "definitions": {
  145. "constvar.AudioStatus": {
  146. "type": "integer",
  147. "enum": [
  148. 0,
  149. 1,
  150. 2,
  151. 3,
  152. 4
  153. ],
  154. "x-enum-comments": {
  155. "AudioStatusFailed": "处理失败",
  156. "AudioStatusFinish": "处理完成",
  157. "AudioStatusProcessing": "处理中",
  158. "AudioStatusUploadOk": "上传成功 待处理",
  159. "AudioStatusUploading": "上传中"
  160. },
  161. "x-enum-varnames": [
  162. "AudioStatusUploading",
  163. "AudioStatusUploadOk",
  164. "AudioStatusProcessing",
  165. "AudioStatusFinish",
  166. "AudioStatusFailed"
  167. ]
  168. },
  169. "constvar.BoolType": {
  170. "type": "integer",
  171. "enum": [
  172. 1,
  173. 2
  174. ],
  175. "x-enum-comments": {
  176. "BoolTypeFalse": "false",
  177. "BoolTypeTrue": "true"
  178. },
  179. "x-enum-varnames": [
  180. "BoolTypeTrue",
  181. "BoolTypeFalse"
  182. ]
  183. },
  184. "gorm.DeletedAt": {
  185. "type": "object",
  186. "properties": {
  187. "time": {
  188. "type": "string"
  189. },
  190. "valid": {
  191. "description": "Valid is true if Time is not NULL",
  192. "type": "boolean"
  193. }
  194. }
  195. },
  196. "models.Audio": {
  197. "type": "object",
  198. "properties": {
  199. "audioStatus": {
  200. "description": "音频状态",
  201. "allOf": [
  202. {
  203. "$ref": "#/definitions/constvar.AudioStatus"
  204. }
  205. ]
  206. },
  207. "createdAt": {
  208. "type": "string"
  209. },
  210. "deletedAt": {
  211. "$ref": "#/definitions/gorm.DeletedAt"
  212. },
  213. "driverNumber": {
  214. "description": "司机号",
  215. "type": "string"
  216. },
  217. "id": {
  218. "type": "integer"
  219. },
  220. "isFollowed": {
  221. "description": "是否关注 1关注 2未关注",
  222. "allOf": [
  223. {
  224. "$ref": "#/definitions/constvar.BoolType"
  225. }
  226. ]
  227. },
  228. "locomotiveNumber": {
  229. "description": "机车号",
  230. "type": "string"
  231. },
  232. "name": {
  233. "description": "音频名称",
  234. "type": "string"
  235. },
  236. "occurrenceTime": {
  237. "type": "string"
  238. },
  239. "size": {
  240. "description": "音频大小",
  241. "type": "integer"
  242. },
  243. "stationNumber": {
  244. "description": "车站号",
  245. "type": "string"
  246. },
  247. "trainNumber": {
  248. "description": "车次",
  249. "type": "string"
  250. },
  251. "updatedAt": {
  252. "type": "string"
  253. }
  254. }
  255. },
  256. "request.ProcessAudio": {
  257. "type": "object",
  258. "required": [
  259. "id"
  260. ],
  261. "properties": {
  262. "id": {
  263. "type": "integer"
  264. }
  265. }
  266. },
  267. "util.Response": {
  268. "type": "object",
  269. "properties": {
  270. "code": {
  271. "type": "integer"
  272. },
  273. "data": {},
  274. "msg": {
  275. "type": "string"
  276. }
  277. }
  278. },
  279. "util.ResponseList": {
  280. "type": "object",
  281. "properties": {
  282. "code": {
  283. "type": "integer"
  284. },
  285. "data": {},
  286. "msg": {
  287. "type": "string"
  288. },
  289. "page": {
  290. "type": "integer"
  291. },
  292. "pageSize": {
  293. "type": "integer"
  294. },
  295. "total": {
  296. "type": "integer"
  297. }
  298. }
  299. }
  300. }
  301. }