lyhzzz 3 年之前
父節點
當前提交
f3f51ddae0

+ 5 - 3
src/main/java/com/fdkankan/fusion/common/util/OBJToGLBUtil.java

@@ -12,7 +12,9 @@ public class OBJToGLBUtil {
 
     public static void objToGlb(String objPath, String glbPath)  {
         log.info("obj转换glb开始,{}",objPath);
-        checkObj(objPath);
+        if(!checkObj(objPath)){
+            throw new BusinessException(-1,"obj文件错误");
+        }
         objPath += "/mesh.obj";
         log.info("obj转换glb开始");
         String command = "obj2gltf " + objPath + " " + glbPath;
@@ -33,10 +35,10 @@ public class OBJToGLBUtil {
             if(file2.isDirectory()){
                 return checkObj(file2.getPath());
             }
-            if(file2.getName().contains("obj") ){
+            if(file2.getName().contains(".obj") ){
                 objFile = file2;
             }
-            if(file2.getName().contains("mtl") ){
+            if(file2.getName().contains(".mtl") ){
                 mtlFile = file2;
             }
         }

+ 14 - 0
src/main/java/com/fdkankan/fusion/common/util/StringUtils.java

@@ -0,0 +1,14 @@
+package com.fdkankan.fusion.common.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class StringUtils {
+
+    public static boolean isChinese(String str) {
+        String regEx = "[\\u4e00-\\u9fa5]+";
+        Pattern p = Pattern.compile(regEx);
+        Matcher m = p.matcher(str);
+        return m.find();
+    }
+}

+ 1 - 1
src/main/java/com/fdkankan/fusion/entity/CaseTagPoint.java

@@ -51,7 +51,7 @@ public class CaseTagPoint implements Serializable {
     @TableField("sort")
     private Integer sort;
 
-    @TableField("fusionId")
+    @TableField("fusion_id")
     private Integer fusionId;
 
     @TableField("tb_status")