|
|
|
|
@ -339,8 +339,8 @@ public class CameraControlController {
|
|
|
|
|
ConfigProperties.SavePath savePath = configProperties.getSavePath();
|
|
|
|
|
String path = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))+".jpeg";
|
|
|
|
|
String filePath = "D:\\work\\"+path;
|
|
|
|
|
TaskDelayExecutor.addPicDelayTask(id,filePath,2000L,savePath);
|
|
|
|
|
return Result.success(configProperties.getCameraConfig().getWorkUrl()+path);
|
|
|
|
|
TaskDelayExecutor.addPicDelayTask(id,filePath,0L,savePath);
|
|
|
|
|
return Result.success(configProperties.getServerOpenInfo().getDomain()+configProperties.getServerOpenInfo().getWork()+path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
@ -373,12 +373,12 @@ public class CameraControlController {
|
|
|
|
|
@ApiOperation(value = "录像")
|
|
|
|
|
public Result<String> record(@RequestBody CameraRecord cameraRecord) {
|
|
|
|
|
checkLogin(cameraRecord.getCameraId());
|
|
|
|
|
String url ="work\\"+cameraRecord.getStartTime().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))+".mp4";
|
|
|
|
|
String url ="work/"+cameraRecord.getStartTime().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))+".mp4";
|
|
|
|
|
cameraRecord.setPath(url);
|
|
|
|
|
cameraRecordMapper.insert(cameraRecord);
|
|
|
|
|
ConfigProperties.SavePath savePath = configProperties.getSavePath();
|
|
|
|
|
cameraControlModule.downloadMp4(cameraRecord.getCameraId(),"D:\\"+url, cameraRecord.getStartTime(),cameraRecord.getEndTime(),savePath);
|
|
|
|
|
return Result.success("api/"+url);
|
|
|
|
|
return Result.success(configProperties.getServerOpenInfo().getDomain()+url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/mp4/recordList")
|
|
|
|
|
@ -392,7 +392,7 @@ public class CameraControlController {
|
|
|
|
|
);
|
|
|
|
|
cameraRecordList = cameraRecordList.stream()
|
|
|
|
|
.peek(k ->{
|
|
|
|
|
k.setPath("api/"+k.getPath());
|
|
|
|
|
k.setPath(configProperties.getServerOpenInfo().getDomain()+k.getPath());
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
return Result.success(cameraRecordList);
|
|
|
|
|
}
|
|
|
|
|
|