Sfoglia il codice sorgente

Merge branch 'feature-v4.10.0-20230621-dsx' into release

dsx 2 anni fa
parent
commit
f4e8e41ed8

+ 9 - 1
src/main/java/com/fdkankan/scene/service/impl/SceneCleanOrigServiceImpl.java

@@ -11,6 +11,8 @@ import com.fdkankan.common.constant.CommonSuccessStatus;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.constant.OperationType;
 import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.fyun.config.FYunFileConfig;
+import com.fdkankan.fyun.constant.FYunTypeEnum;
 import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.constants.UploadFilePath;
@@ -65,6 +67,8 @@ public class SceneCleanOrigServiceImpl extends ServiceImpl<ISceneCleanOrigMapper
     private ICameraService cameraService;
     @Autowired
     private ISceneColdStorageService sceneColdStorageService;
+    @Autowired
+    private FYunFileConfig fYunFileConfig;
 
 
     @Autowired
@@ -284,7 +288,11 @@ public class SceneCleanOrigServiceImpl extends ServiceImpl<ISceneCleanOrigMapper
         String homePath = dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, ConstantFilePath.OSS_PREFIX);
 
         //将文件复制到冷归档bucket
-        fYunFileService.copyFileBetweenBucket(bucket, homePath, coldBucket, homePath);
+        if(fYunFileConfig.getFyunType().equals(FYunTypeEnum.AWS.code())){
+            fYunFileService.copyFileToArchive(bucket, homePath, coldBucket, homePath);
+        }else{
+            fYunFileService.copyFileBetweenBucket(bucket, homePath, coldBucket, homePath);
+        }
 
         List<String> origList = fYunFileService.listRemoteFiles(bucket, homePath);
         List<String> coldList = fYunFileService.listRemoteFiles(coldBucket, homePath);