查询合并文件列表增加app,stream, callId过滤参数

pull/1242/head
648540858 2023-11-28 09:30:49 +08:00
parent dbf92b96b0
commit 3d5842e9e2
4 changed files with 20 additions and 5 deletions

View File

@ -257,8 +257,17 @@ public class AssistRESTfulUtils {
return sendPost(mediaServerItem, "api/record/file/download/task/add", videoTaskInfoJSON, null, 30); return sendPost(mediaServerItem, "api/record/file/download/task/add", videoTaskInfoJSON, null, 30);
} }
public JSONObject queryTaskList(MediaServerItem mediaServerItem, String taskId, Boolean isEnd) { public JSONObject queryTaskList(MediaServerItem mediaServerItem, String app, String stream, String callId, String taskId, Boolean isEnd) {
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
if (!ObjectUtils.isEmpty(app)) {
param.put("app", app);
}
if (!ObjectUtils.isEmpty(stream)) {
param.put("stream", stream);
}
if (!ObjectUtils.isEmpty(callId)) {
param.put("callId", callId);
}
if (!ObjectUtils.isEmpty(taskId)) { if (!ObjectUtils.isEmpty(taskId)) {
param.put("taskId", taskId); param.put("taskId", taskId);
} }

View File

@ -38,7 +38,7 @@ public interface ICloudRecordService {
/** /**
* *
*/ */
JSONArray queryTask(String taskId, String mediaServerId, Boolean isEnd); JSONArray queryTask(String app, String stream, String callId, String taskId, String mediaServerId, Boolean isEnd);
/** /**
* *

View File

@ -124,6 +124,9 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
remoteHost = "http://" + mediaServerItem.getStreamIp() + ":" + mediaServerItem.getRecordAssistPort(); remoteHost = "http://" + mediaServerItem.getStreamIp() + ":" + mediaServerItem.getRecordAssistPort();
} }
} }
if (mediaServerItem.getRecordAssistPort() == 0) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "为配置Assist服务");
}
Long startTimeStamp = null; Long startTimeStamp = null;
Long endTimeStamp = null; Long endTimeStamp = null;
if (startTime != null) { if (startTime != null) {
@ -148,7 +151,7 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
} }
@Override @Override
public JSONArray queryTask(String taskId, String mediaServerId, Boolean isEnd) { public JSONArray queryTask(String app, String stream, String callId, String taskId, String mediaServerId, Boolean isEnd) {
MediaServerItem mediaServerItem = null; MediaServerItem mediaServerItem = null;
if (mediaServerId == null) { if (mediaServerId == null) {
mediaServerItem = mediaServerService.getDefaultMediaServer(); mediaServerItem = mediaServerService.getDefaultMediaServer();
@ -158,7 +161,7 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
if (mediaServerItem == null) { if (mediaServerItem == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的流媒体"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的流媒体");
} }
JSONObject result = assistRESTfulUtils.queryTaskList(mediaServerItem, taskId, isEnd); JSONObject result = assistRESTfulUtils.queryTaskList(mediaServerItem, app, stream, callId, taskId, isEnd);
if (result.getInteger("code") != 0) { if (result.getInteger("code") != 0) {
throw new ControllerException(result.getInteger("code"), result.getString("msg")); throw new ControllerException(result.getInteger("code"), result.getString("msg"));
} }

View File

@ -172,11 +172,14 @@ public class CloudRecordController {
@Parameter(name = "mediaServerId", description = "流媒体ID", required = false) @Parameter(name = "mediaServerId", description = "流媒体ID", required = false)
@Parameter(name = "isEnd", description = "是否结束", required = false) @Parameter(name = "isEnd", description = "是否结束", required = false)
public JSONArray queryTaskList( public JSONArray queryTaskList(
@RequestParam(required = false) String app,
@RequestParam(required = false) String stream,
@RequestParam(required = false) String callId,
@RequestParam(required = false) String taskId, @RequestParam(required = false) String taskId,
@RequestParam(required = false) String mediaServerId, @RequestParam(required = false) String mediaServerId,
@RequestParam(required = false) Boolean isEnd @RequestParam(required = false) Boolean isEnd
){ ){
return cloudRecordService.queryTask(taskId, mediaServerId, isEnd); return cloudRecordService.queryTask(app, stream, callId, taskId, mediaServerId, isEnd);
} }
@ResponseBody @ResponseBody