|
@@ -4,7 +4,6 @@ import api.common.pojo.common.ResponseBodyVO;
|
|
import api.common.pojo.po.scene.VehicleTypePO;
|
|
import api.common.pojo.po.scene.VehicleTypePO;
|
|
import api.common.util.LinuxUtil;
|
|
import api.common.util.LinuxUtil;
|
|
import api.common.util.StringUtil;
|
|
import api.common.util.StringUtil;
|
|
-import com.css.simulation.resource.video.configuration.redis.CustomRedisClient;
|
|
|
|
import com.css.simulation.resource.video.service.VideoService;
|
|
import com.css.simulation.resource.video.service.VideoService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -25,8 +24,6 @@ public class VideoController {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
private VideoService videoService;
|
|
private VideoService videoService;
|
|
- @Resource
|
|
|
|
- private CustomRedisClient customRedisClient;
|
|
|
|
@Value("${scheduler.video-test-command}")
|
|
@Value("${scheduler.video-test-command}")
|
|
private String testCommand;
|
|
private String testCommand;
|
|
|
|
|
|
@@ -97,18 +94,17 @@ public class VideoController {
|
|
File folder = new File(savePath);
|
|
File folder = new File(savePath);
|
|
// 判断路径是否存在,不存在则自动创建
|
|
// 判断路径是否存在,不存在则自动创建
|
|
if (!folder.exists()) {
|
|
if (!folder.exists()) {
|
|
- folder.mkdirs();
|
|
|
|
|
|
+ final boolean mkdirs = folder.mkdirs();
|
|
}
|
|
}
|
|
- String saveName = originName;
|
|
|
|
try {
|
|
try {
|
|
- file.transferTo(new File(folder, saveName));
|
|
|
|
|
|
+ file.transferTo(new File(folder, originName));
|
|
Map<String, String> map = new HashMap<>();
|
|
Map<String, String> map = new HashMap<>();
|
|
- String filePath = savePath + "/" + saveName;
|
|
|
|
|
|
+ String filePath = savePath + "/" + originName;
|
|
// return new String("文件路径为:" + filePath);
|
|
// return new String("文件路径为:" + filePath);
|
|
map.put("filePath", filePath);
|
|
map.put("filePath", filePath);
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, map);
|
|
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, map);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, e.getMessage());
|
|
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE, e.getMessage());
|
|
// return new String(e.getMessage());
|
|
// return new String(e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -117,7 +113,7 @@ public class VideoController {
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public ResponseBodyVO<VehicleTypePO> test1(@RequestBody Map<String, String> map) {
|
|
public ResponseBodyVO<VehicleTypePO> test1(@RequestBody Map<String, String> map) {
|
|
VehicleTypePO po = videoService.vehicleById(map.get("projectId"), map.get("projectType"));
|
|
VehicleTypePO po = videoService.vehicleById(map.get("projectId"), map.get("projectType"));
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, po);
|
|
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, po);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|