| | |
| | | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.SerializationFeature; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.oss.core.OssClient; |
| | | import org.dromara.common.oss.entity.SynchronousRequest; |
| | |
| | | this.baseMapper = baseMapper; |
| | | } |
| | | |
| | | // @Scheduled(cron = "0 0/1 * * * ?") |
| | | @Scheduled(cron = "0 0/1 * * * ?") |
| | | public void get() throws IOException { |
| | | System.out.println("同步上传......"); |
| | | |
| | |
| | | InputStream input = FtpApche.downloadFileFromDailyDir(str); |
| | | byte[] fileBytesByName = FtpApche.getFileBytesByName(input); |
| | | OssClient storage = OssFactory.instance(); |
| | | UploadResult uploadResult = storage.upload(input,getPath(fileName),fileName.substring(14,fileName.length())); |
| | | FtpApche.deleteFile(str); |
| | | MultipartFile file = new MockMultipartFile(fileName,fileName, fileName.substring(14,fileName.length()), input); |
| | | buildResultEntity(fileName, fileName.substring(14,fileName.length()), "minio", uploadResult, file, |
| | | password, fileBytesByName); |
| | | // 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"); |
| | | |
| | | FtpApche.deleteFile(str); |
| | | input.close(); |
| | | // buildResultEntity(fileName, fileName.substring(14,fileName.length()), "minio", uploadResult, file, |
| | | // password, fileBytesByName); |
| | | |
| | | } |
| | | |