浏览代码

直接加载obj模型

lyhzzz 8 月之前
父节点
当前提交
fba904e932

+ 11 - 1
src/main/java/com/fdkankan/fusion/FusionApplication.java

@@ -1,6 +1,9 @@
 package com.fdkankan.fusion;
 
+import com.fdkankan.fusion.config.CacheUtil;
 import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.ComponentScan;
@@ -13,10 +16,17 @@ import org.springframework.web.socket.config.annotation.EnableWebSocket;
 @EnableScheduling
 @ComponentScan(basePackages = {"com.fdkankan.*"})
 @MapperScan("com.fdkankan.**.mapper")
-public class FusionApplication {
+public class FusionApplication  implements CommandLineRunner {
 
+    @Value("${upload.type}")
+    private String uploadType;
     public static void main(String[] args) {
         SpringApplication.run(FusionApplication.class, args);
     }
 
+    @Override
+    public void run(String... args) throws Exception {
+        CacheUtil.uploadType = uploadType;
+
+    }
 }

+ 4 - 3
src/main/java/com/fdkankan/fusion/common/util/ShellUtil.java

@@ -2,6 +2,7 @@ package com.fdkankan.fusion.common.util;
 
 import cn.hutool.core.io.file.FileReader;
 import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.fusion.config.CacheUtil;
 import lombok.extern.slf4j.Slf4j;
 
 import java.io.*;
@@ -178,18 +179,18 @@ public class ShellUtil {
      */
     public static void yunUpload(String srcPath,String destPath){
         String opType = srcPath.contains(".")? "file":"folder" ;
-        String cmd = String.format(ShellCmd.FYUN_UPLOAD, "4dkankan",srcPath,destPath,"local",opType);
+        String cmd = String.format(ShellCmd.FYUN_UPLOAD, "4dkankan",srcPath,destPath, CacheUtil.uploadType,opType);
         execCmd(cmd);
     }
     public static void yunDownload(String srcPath,String destPath){
         String opType = srcPath.contains(".")? "file":"folder" ;
-        String cmd = String.format(ShellCmd.FYUN_DOWN,"4dkankan",srcPath,destPath,"local",opType);
+        String cmd = String.format(ShellCmd.FYUN_DOWN,"4dkankan",srcPath,destPath, CacheUtil.uploadType,opType);
         execCmd(cmd);
     }
 
     public static void yunDownloadSs(String srcPath,String destPath){
         String opType = srcPath.contains(".")? "file":"folder" ;
-        String cmd = String.format(ShellCmd.FYUN_DOWN,"laser-data",srcPath,destPath,"minio",opType);
+        String cmd = String.format(ShellCmd.FYUN_DOWN,"laser-data",srcPath,destPath, CacheUtil.uploadType,opType);
         execCmd(cmd);
     }
 }

+ 6 - 0
src/main/java/com/fdkankan/fusion/config/CacheUtil.java

@@ -0,0 +1,6 @@
+package com.fdkankan.fusion.config;
+
+public class CacheUtil {
+    public static String uploadType;
+
+}