|
@@ -172,23 +172,20 @@ public class ComputerUtil {
|
|
}
|
|
}
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
-//
|
|
|
|
- public static void createJson(String path, String splitType, String skyboxType, String dataDescribe,
|
|
|
|
- String sceneNum, String dataSource) throws Exception{
|
|
|
|
|
|
+
|
|
|
|
+ public static void createProjectAndDataFile(String path, String sceneNum, String splitType, String skyboxType,
|
|
|
|
+ Map<String, Object> projectExtras, Map<String, Object> dataExtras) {
|
|
JSONObject projectJson = new JSONObject();
|
|
JSONObject projectJson = new JSONObject();
|
|
- projectJson.put("version", "201909231830");
|
|
|
|
- projectJson.put("protocol", "file api 1.4");
|
|
|
|
- projectJson.put("uuid", UUID.randomUUID().toString());
|
|
|
|
- projectJson.put("description", "");
|
|
|
|
- projectJson.put("time", System.currentTimeMillis());
|
|
|
|
- projectJson.put("category", "default");
|
|
|
|
- projectJson.put("tag", null);
|
|
|
|
- projectJson.put("status", null);
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(projectExtras)) {
|
|
|
|
+ projectJson.putAll(projectExtras);
|
|
|
|
+ }
|
|
projectJson.put("sceneNum", sceneNum);
|
|
projectJson.put("sceneNum", sceneNum);
|
|
- projectJson.put("dataSource", dataSource);
|
|
|
|
FileUtils.writeFile(path + File.separator + "project.json", projectJson.toString());
|
|
FileUtils.writeFile(path + File.separator + "project.json", projectJson.toString());
|
|
|
|
|
|
JSONObject dataJson = new JSONObject();
|
|
JSONObject dataJson = new JSONObject();
|
|
|
|
+ if (!ObjectUtils.isEmpty(dataExtras)) {
|
|
|
|
+ dataJson.putAll(dataExtras);
|
|
|
|
+ }
|
|
dataJson.put("split_type", splitType);
|
|
dataJson.put("split_type", splitType);
|
|
dataJson.put("skybox_type", skyboxType);
|
|
dataJson.put("skybox_type", skyboxType);
|
|
dataJson.put("extras", null);
|
|
dataJson.put("extras", null);
|