|
@@ -82,15 +82,25 @@ public class ThreadService {
|
|
|
|
|
|
String name = file1.getName();
|
|
|
if(name.contains("obj") || name.contains("OBJ")){
|
|
|
- model.setModelDateType("b3dm");
|
|
|
- model.setModelType("b3dm");
|
|
|
- String localPath = file1.getParentFile().getPath()+"/b3dm";
|
|
|
+// model.setModelDateType("b3dm");
|
|
|
+// model.setModelType("b3dm");
|
|
|
+// String localPath = file1.getParentFile().getPath()+"/b3dm";
|
|
|
+//
|
|
|
+// OBJToGLBUtil.objToB3dm(file1.getPath(),localPath);
|
|
|
+// redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"65");
|
|
|
+// ossPath = localPath.replace("/mnt/","");
|
|
|
+// ShellUtil.yunUpload(localPath,ossPath);
|
|
|
+// model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath + ossPath+"/tileset.json")));
|
|
|
|
|
|
- OBJToGLBUtil.objToB3dm(file1.getPath(),localPath);
|
|
|
+ String localPath = file1.getPath().replace(".obj", ".glb");
|
|
|
+ model.setModelDateType("obj");
|
|
|
+ model.setModelType("glb");
|
|
|
+ OBJToGLBUtil.objToGlb2(file1.getPath(),localPath);
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"65");
|
|
|
- ossPath = localPath.replace("/mnt/","");
|
|
|
- ShellUtil.yunUpload(localPath,ossPath);
|
|
|
- model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath + ossPath+"/tileset.json")));
|
|
|
+ uploadToOssUtil.uploadOss(localPath,localPath.replace("/mnt/",""));
|
|
|
+ if(!uploadToOssUtil.existKey(ossPath)){
|
|
|
+ throw new BusinessException(-1,"缺少.glb文件");
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
if(name.contains(".ply")){
|