|
|
@@ -1,11 +1,10 @@ |
|
|
|
package com.hz.pm.api.external; |
|
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
import cn.hutool.core.io.IoUtil; |
|
|
|
import cn.hutool.core.io.resource.ClassPathResource; |
|
|
|
import cn.hutool.core.lang.TypeReference; |
|
|
|
import cn.hutool.core.lang.UUID; |
|
|
|
import cn.hutool.core.util.RandomUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
@@ -21,7 +20,6 @@ import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.File; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Collections; |
|
|
@@ -76,7 +74,8 @@ public class MhFileClient { |
|
|
|
try { |
|
|
|
List<MhFileInfoDTO> files = listFileInfo(fileId); |
|
|
|
MhFileInfoDTO file = files.get(0); |
|
|
|
String tmpFilePath = FileUtil.getTmpDirPath() + file.getFileName() + "." + file.getFileSuffix(); |
|
|
|
String tmpDirPath = StrUtil.appendIfMissing(FileUtil.getTmpDirPath(), "/"); |
|
|
|
String tmpFilePath = tmpDirPath + file.getFileName() + "." + file.getFileSuffix(); |
|
|
|
File tmpFile = new File(tmpFilePath); |
|
|
|
long size = HttpUtil.downloadFile(fileUrl, tmpFile); |
|
|
|
log.info("下载文件:{},大小为:{}", fileId, size); |
|
|
|