Commit 8cf2afa1 by 翁国栋

异步上传

parent a161fa0b
...@@ -8,6 +8,7 @@ import com.jcraft.jsch.ChannelSftp; ...@@ -8,6 +8,7 @@ import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.SftpException; import com.jcraft.jsch.SftpException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -60,6 +61,7 @@ public class FtpServiceImpl implements FtpService { ...@@ -60,6 +61,7 @@ public class FtpServiceImpl implements FtpService {
return false; return false;
} }
@Async("threadPoolTaskExecutor")
@Override @Override
public List<FileInfoDto> uploadFile(String targetPath, MultipartFile[] files, boolean reservedName) { public List<FileInfoDto> uploadFile(String targetPath, MultipartFile[] files, boolean reservedName) {
ChannelSftp sftp = config.getSftpSocket(); ChannelSftp sftp = config.getSftpSocket();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment