修复云端录像查询时间错误

结构优化
648540858 2024-01-04 11:09:34 +08:00
parent aa3c678839
commit 5f4d148353
3 changed files with 27 additions and 2 deletions

View File

@ -55,4 +55,9 @@ public interface ICloudRecordService {
*
*/
DownloadFileInfo getPlayUrlPath(Integer recordId);
/**
*
*/
DownloadFileInfo getLivePath(Integer recordId);
}

View File

@ -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);

View File

@ -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);
}
}