lyhzzz 3 年 前
コミット
aa180ab52e

+ 3 - 3
src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java

@@ -84,10 +84,10 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
         this.save(model);
         this.save(model);
         try {
         try {
             String objPath = String.format(OBJ_PATH , "modelId_"+model.getModelId());
             String objPath = String.format(OBJ_PATH , "modelId_"+model.getModelId());
-            String glbPath = String.format(GLB_PATH , "modelId_"+model.getModelId());
+            String glbPath = String.format(GLB_PATH , "modelId_"+model.getModelId()) +"/"+modelName +"/mesh.glb";
             String glbOssPath = String.format(FilePath.GLB_OSS_PATH, model.getModelId());
             String glbOssPath = String.format(FilePath.GLB_OSS_PATH, model.getModelId());
             model.setModelObjUrl(objPath);
             model.setModelObjUrl(objPath);
-            model.setModelGlbUrl(queryPath +"/"+glbPath + "/"+modelName +"/mesh.glb");
+            model.setModelGlbUrl(glbOssPath);
 
 
             File newObjFile = new File(objPath +"/" + fileName);
             File newObjFile = new File(objPath +"/" + fileName);
             if(!newObjFile.getParentFile().exists()){
             if(!newObjFile.getParentFile().exists()){
@@ -101,7 +101,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
                 CreateObjUtil.unRar(newObjFile.getPath(),objPath);
                 CreateObjUtil.unRar(newObjFile.getPath(),objPath);
             }
             }
 
 
-            OBJToGLBUtil.objToGlb(objPath+"/"+modelName,glbPath+"/"+modelName +"/mesh.glb");
+            OBJToGLBUtil.objToGlb(objPath+"/"+modelName,glbPath);
             uploadToOssUtil.upload(glbPath,glbOssPath);
             uploadToOssUtil.upload(glbPath,glbOssPath);
 
 
             model.setCreateStatus(1);  //上传成功
             model.setCreateStatus(1);  //上传成功