| | |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | | import com.genersoft.iot.vmp.service.impl.StreamPushUploadFileHandler; |
| | | import com.genersoft.iot.vmp.vmanager.bean.BatchGBStreamParam; |
| | | import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto; |
| | | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| | | import com.github.pagehelper.PageInfo; |
| | |
| | | }) |
| | | @PostMapping(value = "/stop") |
| | | @ResponseBody |
| | | public Object removeFormGB(@RequestParam(required = true)String app, @RequestParam(required = true)String streamId){ |
| | | public Object stop(String app, String streamId){ |
| | | if (streamPushService.stop(app, streamId)){ |
| | | return "success"; |
| | | }else { |
| | | return "fail"; |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("中止多个推流") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "app", value = "应用名", required = true, dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "streamId", value = "流ID", required = true, dataTypeClass = String.class), |
| | | }) |
| | | @DeleteMapping(value = "/batchStop") |
| | | @ResponseBody |
| | | public Object batchStop(@RequestBody BatchGBStreamParam batchGBStreamParam){ |
| | | if (batchGBStreamParam.getGbStreams().size() == 0) { |
| | | return "fail"; |
| | | } |
| | | if (streamPushService.batchStop(batchGBStreamParam.getGbStreams())){ |
| | | return "success"; |
| | | }else { |
| | | return "fail"; |
| | | } |
| | | } |
| | | |
| | | @PostMapping(value = "upload") |
| | | @ResponseBody |
| | | public DeferredResult<ResponseEntity<WVPResult<Object>>> uploadChannelFile(@RequestParam(value = "file") MultipartFile file){ |
| | |
| | | result.setResult(ResponseEntity.status(HttpStatus.BAD_REQUEST).body(wvpResult)); |
| | | return result; |
| | | } |
| | | // if (!file.getContentType().endsWith(".xls") |
| | | // && !file.getContentType().endsWith(".csv") |
| | | // && !file.getContentType().endsWith(".xlsx") ) { |
| | | // logger.warn("通道导入文件类型错误: {}",file.getContentType() ); |
| | | // WVPResult<Object> wvpResult = new WVPResult<>(); |
| | | // wvpResult.setCode(-1); |
| | | // wvpResult.setMsg("文件类型错误,请使用"); |
| | | // result.setResult(ResponseEntity.status(HttpStatus.BAD_REQUEST).body(wvpResult)); |
| | | // return result; |
| | | // } |
| | | // 同时只处理一个文件 |
| | | if (resultHolder.exist(key, null)) { |
| | | logger.warn("已有导入任务正在执行"); |