Kaynağa Gözat

上传修改路径

lyhzzz 3 yıl önce
ebeveyn
işleme
50667d1ab5

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -72,7 +72,7 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
     private String getGlbUrl(Integer type, String num) {
         if(type == 0 || type == 1){ //看看,看见
             String objPath = String.format(OBJ_PATH ,num);
-            String glbPath = String.format(GLB_PATH,num);
+            String glbPath = String.format(GLB_PATH,num) +"/mesh.glb";
             String glbOssPath = String.format(FilePath.GLB_OSS_PATH , num);
             List<String> fileList = uploadToOssUtil.listKeysFromAli(String.format(FilePath.OBJ_OSS_PATH, num));
             for (String fileName : fileList) {
@@ -84,7 +84,7 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
                 uploadToOssUtil.downFormAli(fileName,objPath +"/"+split[split.length-1]);
             }
 
-            OBJToGLBUtil.objToGlb(objPath,glbPath);
+            OBJToGLBUtil.objToGlb(objPath,glbPath );
             uploadToOssUtil.upload(glbPath,glbOssPath);
             return queryPath + "/"+glbOssPath;
         }

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

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

+ 1 - 1
src/main/resources/application-dev.yaml

@@ -26,4 +26,4 @@ spring:
 
 local:
   obj_path: /home/fusion/model/%s
-  glb_path: /home/fusion/model/%s/mesh.glb
+  glb_path: /home/fusion/model/%s