浏览代码

matterpro-4

dsx 2 年之前
父节点
当前提交
d8c7643570

+ 9 - 0
src/main/java/com/fdkankan/scene/controller/TestController.java

@@ -1,5 +1,6 @@
 package com.fdkankan.scene.controller;
 
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.web.response.ResultData;
 import com.fdkankan.scene.bean.RequestRebuildVedioScene;
 import com.fdkankan.scene.service.ISceneResourceService;
@@ -25,6 +26,8 @@ public class TestController {
     private ISceneResourceService sceneResourceService;
     @Autowired
     private IVideoSceneProgressService videoSceneProgressService;
+    @Autowired
+    private FYunFileServiceInterface fYunFileService;
 
     @GetMapping("/test")
     public ResultData test(){
@@ -35,4 +38,10 @@ public class TestController {
         return ResultData.ok();
     }
 
+    @GetMapping("/test2")
+    public ResultData test2(){
+        fYunFileService.uploadFileByCommand("/mnt/data/8ce9d024-424f-4cb4-8ecc-88cd5276c5e8/1382/", "images/imagest-MTIL1rhpRF/");
+        return ResultData.ok();
+    }
+
 }

+ 13 - 12
src/main/java/com/fdkankan/scene/service/impl/InnerApiServiceImpl.java

@@ -134,18 +134,19 @@ public class InnerApiServiceImpl implements IInnerApiService {
                 //删除压缩包
 //                new File(dataSource + file.getOriginalFilename()).delete();
 
-                List<String> fileList = new ArrayList<>();
-                FileUtils.readfilePath(dataSource, fileList);
-                String ossPath = "";
-                Map<String, String> uploadMap = new HashMap<>();
-                for (String filePath : fileList) {
-                    ossPath = filePath.replace(dataSource, "images/images" + sceneNum + "/");
-                    if(ossPath.endsWith("/")){
-                        ossPath = ossPath.substring(0, ossPath.lastIndexOf("/"));
-                    }
-                    uploadMap.put(filePath, ossPath);
-                }
-                fYunFileService.uploadMulFiles(uploadMap);
+//                List<String> fileList = new ArrayList<>();
+//                FileUtils.readfilePath(dataSource, fileList);
+//                String ossPath = "";
+//                Map<String, String> uploadMap = new HashMap<>();
+//                for (String filePath : fileList) {
+//                    ossPath = filePath.replace(dataSource, "images/images" + sceneNum + "/");
+//                    if(ossPath.endsWith("/")){
+//                        ossPath = ossPath.substring(0, ossPath.lastIndexOf("/"));
+//                    }
+//                    uploadMap.put(filePath, ossPath);
+//                }
+//                fYunFileService.uploadMulFiles(uploadMap);
+                fYunFileService.uploadFileByCommand(dataSource, "images/images" + sceneNum + "/");
 
                 ScenePro sceneProEntity = new ScenePro();
                 sceneProEntity.setDataSource(dataSource);