xiangpei
2025-02-17 3e881345e5e8753c0886407a98bff8da9ae54f76
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/sync/VideoPulSync.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.oss.core.OssClient;
@@ -22,6 +23,7 @@
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
@@ -30,7 +32,9 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
@Slf4j
@Component
public class VideoPulSync {
@@ -46,12 +50,10 @@
    @Scheduled(cron = "0 0/1 * * * ?")
    public void get() throws IOException {
        System.out.println("同步上传......");
        List<String> list = FtpApche.downloadList(ftpConfig);
        if(list.size() == 0){
        log.error("同步互联网文件");
        List<String> list = FtpApche.downloadList(this.ftpConfig);
        if (list.size() == 0)
            return;
        }
        for (String str : list) {
            String password = str.substring(0, 6);
            String fileName = str.substring(6, str.length());
@@ -63,7 +65,6 @@
            FtpApche.deleteFile(str);
            buildResultEntity(fileName, fileName.substring(14, fileName.length()), "minio", uploadResult, (MultipartFile)mockMultipartFile, password, fileBytesByName);
        }
    }
    @NotNull