|
@@ -117,42 +117,70 @@ public class UnityServiceImpl implements IUnityService {
|
|
|
|
|
|
String xspaceSceneOssPath = String.format(OSSPathConstant.XSPACE_SCENE_FORMAT,bean.getNum(), bean.getSerial());
|
|
|
|
|
|
+ //复制user
|
|
|
+ String sourceUserPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_USER, bean.getNum());
|
|
|
+ String targetUserPath = xspaceSceneOssPath + "user/";
|
|
|
+ fYunFileService.copyFileInBucket(sourceUserPath, targetUserPath);
|
|
|
+
|
|
|
+ //复制data
|
|
|
+ String sourceDataPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_DATA, bean.getNum());
|
|
|
+ String targetDataPath = xspaceSceneOssPath + "data/";
|
|
|
+ fYunFileService.copyFileInBucket(sourceDataPath, targetDataPath);
|
|
|
+ //删除mesh
|
|
|
+ fYunFileService.deleteFolder(targetDataPath + "mesh");
|
|
|
+
|
|
|
+ //复制images
|
|
|
+ String sourceImagesPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_IMAGES, bean.getNum());
|
|
|
+ String targetImagesPath = xspaceSceneOssPath + "images/";
|
|
|
+ fYunFileService.copyFileInBucket(sourceImagesPath, targetImagesPath);
|
|
|
+
|
|
|
+ //复制video
|
|
|
+ String sourceVideoPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_VIDEO, bean.getNum());
|
|
|
+ String targetVideoPath = xspaceSceneOssPath + "video/";
|
|
|
+ fYunFileService.copyFileInBucket(sourceVideoPath, targetVideoPath);
|
|
|
+
|
|
|
+ //复制vioce
|
|
|
+ String sourceVoicePath = String.format(OSSPathConstant.SCENE_VIEW_DATA_VOICE, bean.getNum());
|
|
|
+ String targetVoicePath = xspaceSceneOssPath + "vioce/";
|
|
|
+ fYunFileService.copyFileInBucket(sourceVoicePath, targetVoicePath);
|
|
|
+
|
|
|
//上传mesh
|
|
|
List<File> fileList = FileUtil.loopFiles(workPath);
|
|
|
fileList.parallelStream().forEach(v->{
|
|
|
- fYunFileService.uploadFile(v.getAbsolutePath(), v.getAbsolutePath().replace(workPath, xspaceSceneOssPath));
|
|
|
+ fYunFileService.uploadFile(v.getAbsolutePath(), v.getAbsolutePath().replace(workPath, targetDataPath));
|
|
|
});
|
|
|
|
|
|
//上传文件映射json
|
|
|
// fYunFileService.uploadFile(workPath + "xxx.json", xspaceSceneOssPath + "xxx.json");
|
|
|
|
|
|
- //复制skybox图
|
|
|
- String sourceImagesPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_IMAGES, bean.getNum()) + "tiles/4k/";
|
|
|
- String targetImagesPath = xspaceSceneOssPath + "images/";
|
|
|
- fYunFileService.copyFileInBucket(sourceImagesPath, targetImagesPath);
|
|
|
-
|
|
|
- //复制user
|
|
|
- String sourceUserPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_USER, bean.getNum());
|
|
|
- String targetUserPath = xspaceSceneOssPath + "user/";
|
|
|
- fYunFileService.copyFileInBucket(sourceUserPath, targetUserPath);
|
|
|
-
|
|
|
- //上传getInfo.json
|
|
|
- String getInfoKey = xspaceSceneOssPath + "getInfo.json";
|
|
|
- SceneInfoVO getInfoJson = this.getSceneInfo4View(bean.getNum());
|
|
|
- fYunFileService.uploadFile(JSON.toJSONString(getInfoJson).toString().getBytes(StandardCharsets.UTF_8), getInfoKey);
|
|
|
-
|
|
|
- //上传floorplan.json
|
|
|
- String floorplanPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_DATA, bean.getNum()) + "floorplan.json";
|
|
|
- if(getInfoJson.getFloorPlanUser() == 1){
|
|
|
- floorplanPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_USER, bean.getNum()) + "floorplan.json";
|
|
|
- }
|
|
|
- String xspaceFloorplanPath = xspaceSceneOssPath + "floorplan.json";
|
|
|
- fYunFileService.copyFileInBucket(floorplanPath, xspaceFloorplanPath);
|
|
|
+// //复制skybox图
|
|
|
+// String sourceImagesPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_IMAGES, bean.getNum()) + "tiles/4k/";
|
|
|
+// String targetImagesPath = xspaceSceneOssPath + "images/";
|
|
|
+// fYunFileService.copyFileInBucket(sourceImagesPath, targetImagesPath);
|
|
|
+//
|
|
|
+// //复制user
|
|
|
+// String sourceUserPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_USER, bean.getNum());
|
|
|
+// String targetUserPath = xspaceSceneOssPath + "user/";
|
|
|
+// fYunFileService.copyFileInBucket(sourceUserPath, targetUserPath);
|
|
|
+//
|
|
|
+// //上传getInfo.json
|
|
|
+// String getInfoKey = xspaceSceneOssPath + "getInfo.json";
|
|
|
+// SceneInfoVO getInfoJson = this.getSceneInfo4View(bean.getNum());
|
|
|
+// fYunFileService.uploadFile(JSON.toJSONString(getInfoJson).toString().getBytes(StandardCharsets.UTF_8), getInfoKey);
|
|
|
+//
|
|
|
+// //上传floorplan.json
|
|
|
+// String floorplanPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_DATA, bean.getNum()) + "floorplan.json";
|
|
|
+// if(getInfoJson.getFloorPlanUser() == 1){
|
|
|
+// floorplanPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_USER, bean.getNum()) + "floorplan.json";
|
|
|
+// }
|
|
|
+// String xspaceFloorplanPath = xspaceSceneOssPath + "floorplan.json";
|
|
|
+// fYunFileService.copyFileInBucket(floorplanPath, xspaceFloorplanPath);
|
|
|
+//
|
|
|
+// //复制vision.modeldata
|
|
|
+// String sourceVisionPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_IMAGES, bean.getNum()) + "vision.modeldata";
|
|
|
+// String tagetVisionPath = xspaceSceneOssPath + "vision.modeldata";
|
|
|
+// fYunFileService.copyFileInBucket(sourceVisionPath, tagetVisionPath);
|
|
|
|
|
|
- //复制vision.modeldata
|
|
|
- String sourceVisionPath = String.format(OSSPathConstant.SCENE_VIEW_DATA_IMAGES, bean.getNum()) + "vision.modeldata";
|
|
|
- String tagetVisionPath = xspaceSceneOssPath + "vision.modeldata";
|
|
|
- fYunFileService.copyFileInBucket(sourceVisionPath, tagetVisionPath);
|
|
|
|
|
|
}
|
|
|
|