|
@@ -3,11 +3,9 @@ package cn.com.qmth.examcloud.exchange.inner.api.client;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
-import org.apache.commons.fileupload.disk.DiskFileItem;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.web.client.RestTemplate;
|
|
import org.springframework.web.client.RestTemplate;
|
|
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
|
|
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
|
@@ -53,11 +51,9 @@ public class UpyunCloudServiceClient extends ExchangeCloudClientSupport
|
|
params.put("siteId", req.getSiteId());
|
|
params.put("siteId", req.getSiteId());
|
|
params.put("rootOrgId", String.valueOf(req.getRootOrgId()));
|
|
params.put("rootOrgId", String.valueOf(req.getRootOrgId()));
|
|
params.put("userId", String.valueOf(req.getUserId()));
|
|
params.put("userId", String.valueOf(req.getUserId()));
|
|
|
|
+ params.put("filePath", req.getFilePath());
|
|
|
|
|
|
- CommonsMultipartFile file = req.getFile();
|
|
|
|
- DiskFileItem item = (DiskFileItem) file.getFileItem();
|
|
|
|
- File storeLocation = item.getStoreLocation();
|
|
|
|
- return postForm("upyun/putFile", params, storeLocation, PutFileResp.class);
|
|
|
|
|
|
+ return postForm("upyun/putFile", params, new File(req.getFilePath()), PutFileResp.class);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|