| | |
| | | import com.genersoft.iot.vmp.service.ICloudRecordService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.CloudRecordItem; |
| | | import com.genersoft.iot.vmp.service.bean.DownloadFileInfo; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.storager.dao.CloudRecordServiceMapper; |
| | | import com.genersoft.iot.vmp.utils.CloudRecordUtils; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.github.pagehelper.PageHelper; |
| | |
| | | } |
| | | |
| | | @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 stream != null; |
| | |
| | | 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()) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "未检索到视频文件"); |
| | | } |
| | |
| | | public int changeCollectById(Integer recordId, boolean result) { |
| | | return cloudRecordServiceMapper.changeCollectById(result, recordId); |
| | | } |
| | | |
| | | @Override |
| | | public DownloadFileInfo getPlayUrlPath(Integer recordId) { |
| | | CloudRecordItem recordItem = cloudRecordServiceMapper.queryOne(recordId); |
| | | if (recordItem == null) { |
| | | throw new ControllerException(ErrorCode.ERROR400.getCode(), "资源不存在"); |
| | | } |
| | | String filePath = recordItem.getFilePath(); |
| | | MediaServerItem mediaServerItem = mediaServerService.getOne(recordItem.getMediaServerId()); |
| | | return CloudRecordUtils.getDownloadFilePath(mediaServerItem, filePath); |
| | | } |
| | | } |