swagger.json 12 KB

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