|
@@ -3,8 +3,8 @@ package com.css.simulation.resource.video.controller;
|
|
|
import api.common.pojo.common.ResponseBodyVO;
|
|
|
import api.common.util.LinuxUtil;
|
|
|
import com.css.simulation.resource.video.service.VideoService;
|
|
|
-import org.springframework.http.MediaType;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -15,12 +15,14 @@ public class VideoController {
|
|
|
|
|
|
@Resource
|
|
|
VideoService videoService;
|
|
|
+ @Value ("${scheduler.video-test-command}")
|
|
|
+ String testCommand;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 接受 xosc 文件
|
|
|
*/
|
|
|
- @PostMapping(value = "/generate", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
|
|
+ @RequestMapping(value = "/generate")
|
|
|
public ResponseBodyVO<String> generateVideo(String projectId, String projectType, String taskId) {
|
|
|
return videoService.generateVideo(projectId, projectType, taskId);
|
|
|
}
|
|
@@ -29,11 +31,10 @@ public class VideoController {
|
|
|
/**
|
|
|
* 接受 xosc 文件
|
|
|
*/
|
|
|
- @PostMapping(value = "/test", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
|
|
+ @RequestMapping(value = "/test")
|
|
|
public void testGenerateVideo() throws IOException {
|
|
|
- LinuxUtil.execute("/root/simulation-cloud/esmini/build/EnvironmentSimulator/code-examples/image-capture/image-capture " +
|
|
|
- "/root/simulation-cloud/esmini/resources/xosc/lane_change_crest.xosc " +
|
|
|
- "/root/simulation-cloud/esmini/test/screenshot");
|
|
|
+// LinuxUtil.execute("/root/disk1/simulation-cloud/esmini/code-examples-bin/image-capture /root/disk1/simulation-cloud/esmini/resources/xosc/lane_change_crest.xosc /root/disk1/simulation-cloud/esmini/test/screenshot ");
|
|
|
+ LinuxUtil.execute(testCommand);
|
|
|
}
|
|
|
|
|
|
|