From 5f4d1483533009a6084e4ddab909d67501216e3e Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 4 Jan 2024 11:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=91=E7=AB=AF=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E6=9F=A5=E8=AF=A2=E6=97=B6=E9=97=B4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/ICloudRecordService.java | 5 +++++ .../service/impl/CloudRecordServiceImpl.java | 4 ++-- .../cloudRecord/CloudRecordController.java | 20 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) 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 83b1b151..d1f9f535 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java @@ -55,4 +55,9 @@ public interface ICloudRecordService { * 获取播放地址 */ DownloadFileInfo getPlayUrlPath(Integer recordId); + + /** + * 点播视频流 + */ + DownloadFileInfo getLivePath(Integer recordId); } 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 c9ed173a..d0c46862 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 @@ -57,14 +57,14 @@ public class CloudRecordServiceImpl implements ICloudRecordService { if (!DateUtil.verification(startTime, DateUtil.formatter)) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "开始时间格式错误,正确格式为: " + DateUtil.formatter); } - startTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(startTime); + startTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(startTime) * 1000; } if (endTime != null ) { if (!DateUtil.verification(endTime, DateUtil.formatter)) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "结束时间格式错误,正确格式为: " + DateUtil.formatter); } - endTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime); + endTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime) * 1000; } PageHelper.startPage(page, count); 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 67ce5ecc..086c268d 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 @@ -252,4 +252,24 @@ public class CloudRecordController { ){ return cloudRecordService.getPlayUrlPath(recordId); } + + @ResponseBody + @GetMapping("/download/path") + @Operation(summary = "获取播放地址") + @Parameter(name = "recordId", description = "录像记录的ID", required = true) + public DownloadFileInfo getDownloadPath( + @RequestParam(required = true) Integer recordId + ){ + return cloudRecordService.getPlayUrlPath(recordId); + } + + @ResponseBody + @GetMapping("/play/live") + @Operation(summary = "获取点播i地址") + @Parameter(name = "recordId", description = "录像记录的ID", required = true) + public DownloadFileInfo getLivePath( + @RequestParam(required = true) Integer recordId + ){ + return cloudRecordService.getLivePath(recordId); + } }