From 3d5842e9e2606cbcefed634dddc2867742d3f84e Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 28 Nov 2023 09:30:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=90=88=E5=B9=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0app=EF=BC=8Cstream?= =?UTF-8?q?,=20callId=E8=BF=87=E6=BB=A4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/AssistRESTfulUtils.java | 11 ++++++++++- .../iot/vmp/service/ICloudRecordService.java | 2 +- .../iot/vmp/service/impl/CloudRecordServiceImpl.java | 7 +++++-- .../vmanager/cloudRecord/CloudRecordController.java | 5 ++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java index 4f6d3e92..9fda53e7 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java @@ -257,8 +257,17 @@ public class AssistRESTfulUtils { 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 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)) { param.put("taskId", taskId); } diff --git a/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java b/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java index 8da31e69..87798a08 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java @@ -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); /** * 收藏视频,收藏的视频过期不会删除 diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java index 2954cd82..d9d6fe30 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java @@ -124,6 +124,9 @@ public class CloudRecordServiceImpl implements ICloudRecordService { remoteHost = "http://" + mediaServerItem.getStreamIp() + ":" + mediaServerItem.getRecordAssistPort(); } } + if (mediaServerItem.getRecordAssistPort() == 0) { + throw new ControllerException(ErrorCode.ERROR100.getCode(), "为配置Assist服务"); + } Long startTimeStamp = null; Long endTimeStamp = null; if (startTime != null) { @@ -148,7 +151,7 @@ public class CloudRecordServiceImpl implements ICloudRecordService { } @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; if (mediaServerId == null) { mediaServerItem = mediaServerService.getDefaultMediaServer(); @@ -158,7 +161,7 @@ public class CloudRecordServiceImpl implements ICloudRecordService { if (mediaServerItem == null) { 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) { throw new ControllerException(result.getInteger("code"), result.getString("msg")); } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java index 2c860e1c..41633cf8 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java @@ -172,11 +172,14 @@ public class CloudRecordController { @Parameter(name = "mediaServerId", description = "流媒体ID", required = false) @Parameter(name = "isEnd", description = "是否结束", required = false) 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 mediaServerId, @RequestParam(required = false) Boolean isEnd ){ - return cloudRecordService.queryTask(taskId, mediaServerId, isEnd); + return cloudRecordService.queryTask(app, stream, callId, taskId, mediaServerId, isEnd); } @ResponseBody