xiangpei
2025-02-17 2e4045466a7893180dc963308c6369b47a6ebaf1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/sync/VideoPulSync.java
@@ -44,7 +44,7 @@
        this.baseMapper = baseMapper;
    }
    @Scheduled(cron = "0 0/1 * * * ?")
//    @Scheduled(cron = "0 0/1 * * * ?")
    public void get() throws IOException {
        System.out.println("同步上传......");
@@ -60,16 +60,11 @@
            InputStream input = FtpApche.downloadFileFromDailyDir(str);
            byte[] fileBytesByName = FtpApche.getFileBytesByName(input);
            OssClient storage = OssFactory.instance();
            MultipartFile file = new MockMultipartFile(fileName,fileName, fileName.substring(14,fileName.length()), input);
//            UploadResult uploadResult = storage.upload(input,getPath(fileName),"multipart/form-data; charset=ISO-8859-1");
            UploadResult uploadResult;
//            try {
                uploadResult = storage.uploadSuffix2(fileBytesByName, getPath(fileName), "multipart/form-data; charset=ISO-8859-1");
            UploadResult uploadResult = storage.upload(input,getPath(fileName),fileName.substring(14,fileName.length()));
            FtpApche.deleteFile(str);
            input.close();
//            buildResultEntity(fileName, fileName.substring(14,fileName.length()), "minio", uploadResult, file,
//                password, fileBytesByName);
            MultipartFile file = new MockMultipartFile(fileName,fileName, fileName.substring(14,fileName.length()), input);
            buildResultEntity(fileName, fileName.substring(14,fileName.length()), "minio", uploadResult, file,
                password, fileBytesByName);
        }
@@ -104,7 +99,7 @@
    private String post(SynchronousRequest request, byte[] bytes) throws IOException {
        HashMap<String, String> headers = new HashMap<>(3);
        String requestUrl = boundary.getVideo() +  "/resource/synchronization/upload";
        String requestUrl = boundary.getLocalhost() +  "/resource/synchronization/upload";
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
        headers.put("content-type", "application/json");