|
@@ -65,7 +65,17 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
@Autowired
|
|
|
private SceneUserSceneClient sceneUserSceneClient;
|
|
|
|
|
|
- private static final String wwwroot = "wwwroot/";
|
|
|
+ @Value("${path.v3school}")
|
|
|
+ private String v3localPath;
|
|
|
+
|
|
|
+ @Value("${path.zip-local}")
|
|
|
+ private String zipLocalFormat;
|
|
|
+
|
|
|
+ @Value("${path.zip-oss}")
|
|
|
+ private String zipOssFormat;
|
|
|
+
|
|
|
+ @Value("${path.zip-root}")
|
|
|
+ private String wwwroot;
|
|
|
// private static final String[] prefixArr = new String[]{
|
|
|
// "data/data%s/",
|
|
|
// "voice/voice%s/",
|
|
@@ -149,7 +159,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
|
|
|
//代码文件路径
|
|
|
//String v3localPath = "/downloads/v3local/";
|
|
|
- String v3localPath = "F:\\downloads\\v3local\\";
|
|
|
+// String v3localPath = "F:\\downloads\\v3local\\";
|
|
|
|
|
|
try {
|
|
|
Set<String> cacheKeys = new HashSet<>();
|
|
@@ -163,11 +173,12 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
int count = 0;
|
|
|
//定义压缩包
|
|
|
// zipPath = "/downloads/scenes/" + num + ".zip";
|
|
|
- zipPath = "F:\\downloads\\scenes\\" + num + ".zip";
|
|
|
+// zipPath = "F:\\downloads\\scenes\\" + num + ".zip";
|
|
|
+ zipPath = String.format(this.zipLocalFormat, num);
|
|
|
File zipFile = new File(zipPath);
|
|
|
ZipOutputStream out = new ZipOutputStream(zipFile);
|
|
|
|
|
|
- JSONObject getInfoJson = this.zipGetInfoJson(out, num);
|
|
|
+ JSONObject getInfoJson = this.zipGetInfoJson(out, this.wwwroot, num);
|
|
|
String resolution = "2k";
|
|
|
if(getInfoJson.getInt("sceneSource") != null &&
|
|
|
(getInfoJson.getInt("sceneSource") == 3 || getInfoJson.getInt("sceneSource") == 4)){
|
|
@@ -195,7 +206,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
out.close();
|
|
|
|
|
|
//上传压缩包
|
|
|
- String uploadPath = "downloads/scenes/" + num + ".zip";
|
|
|
+ String uploadPath = String.format(this.zipOssFormat, num);
|
|
|
uploadToOssUtil.upload(zipPath, uploadPath);
|
|
|
|
|
|
//更新进度100
|
|
@@ -300,7 +311,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
- private JSONObject zipGetInfoJson(ZipOutputStream out, String num) throws Exception{
|
|
|
+ private JSONObject zipGetInfoJson(ZipOutputStream out, String root, String num) throws Exception{
|
|
|
|
|
|
ResultData<SceneInfoDTO> sceneViewInfo = sceneUserSceneClient.getSceneViewInfo(num);
|
|
|
if(!sceneViewInfo.getSuccess()){
|
|
@@ -318,7 +329,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
getInfoJson.set("needKey", 0);
|
|
|
getInfoJson.set("sceneKey","");
|
|
|
//写入getInfo.json
|
|
|
- String getInfoJsonPath = "wwwroot/data/data"+num + "/getInfo.json";
|
|
|
+ String getInfoJsonPath = root + "data/data"+ num + "/getInfo.json";
|
|
|
this.zipBytes(out, getInfoJsonPath, getInfoJson.toString().getBytes());
|
|
|
return getInfoJson;
|
|
|
}
|