优化录像合并下载,支持不过滤zlm节点ID

pull/1288/head
648540858 2024-01-22 10:16:16 +08:00
parent 07729fbe49
commit 0e94aeaf5f
3 changed files with 9 additions and 4 deletions

View File

@ -32,7 +32,8 @@ public interface ICloudRecordService {
/** /**
* *
*/ */
String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime, String callId, String remoteHost); String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime,
String endTime, String callId, String remoteHost, boolean filterMediaServer);
/** /**

View File

@ -109,7 +109,8 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
} }
@Override @Override
public String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime, String callId, String remoteHost) { public String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime,
String callId, String remoteHost, boolean filterMediaServer) {
// 参数校验 // 参数校验
assert app != null; assert app != null;
assert stream != null; assert stream != null;
@ -125,8 +126,11 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
endTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime); endTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime);
} }
List<MediaServerItem> mediaServers = new ArrayList<>();
mediaServers.add(mediaServerItem);
// 检索相关的录像文件 // 检索相关的录像文件
List<String> filePathList = cloudRecordServiceMapper.queryRecordFilePathList(app, stream, startTimeStamp, endTimeStamp, callId, null); List<String> filePathList = cloudRecordServiceMapper.queryRecordFilePathList(app, stream, startTimeStamp,
endTimeStamp, callId, filterMediaServer ? mediaServers : null);
if (filePathList == null || filePathList.isEmpty()) { if (filePathList == null || filePathList.isEmpty()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未检索到视频文件"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "未检索到视频文件");
} }

View File

@ -177,7 +177,7 @@ public class CloudRecordController {
remoteHost = request.getScheme() + "://" + request.getLocalAddr() + ":" + mediaServerItem.getRecordAssistPort(); remoteHost = request.getScheme() + "://" + request.getLocalAddr() + ":" + mediaServerItem.getRecordAssistPort();
} }
} }
return cloudRecordService.addTask(app, stream, mediaServerItem, startTime, endTime, callId, remoteHost); return cloudRecordService.addTask(app, stream, mediaServerItem, startTime, endTime, callId, remoteHost, mediaServerId != null);
} }
@ResponseBody @ResponseBody