swagger.json 15 KB

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