|
@@ -143,18 +143,21 @@ public class FdkkSceneEditService {
|
|
uploadToOssUtil.upload(path,String.format(hotCdfPath, fdkkHotRequest.getNum()));
|
|
uploadToOssUtil.upload(path,String.format(hotCdfPath, fdkkHotRequest.getNum()));
|
|
}
|
|
}
|
|
|
|
|
|
- public FdkkResponse uploadFiles(FdkkUploadRequest fdkkUploadRequest, MultipartFile files, String token) throws IOException {
|
|
|
|
- String path = null;
|
|
|
|
- if(files !=null && files.getSize() >0){
|
|
|
|
- String fileName = files.getOriginalFilename();
|
|
|
|
- assert fileName != null;
|
|
|
|
- String newFilePath = String.format(hotLocalPath,fdkkUploadRequest.getNum()) + "/"+fileName ;
|
|
|
|
- File newFile = new File(newFilePath);
|
|
|
|
- files.transferTo(newFile);
|
|
|
|
- path = newFile.getPath();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- FdkkResponse fdkkResponse = fdkkClient.uploadFiles(fdkkUploadRequest,path,fdkkSceneService.getFdkkToken(token));
|
|
|
|
|
|
+ public FdkkResponse uploadFiles(FdkkUploadRequest fdkkUploadRequest, MultipartFile[] files, String token) throws IOException {
|
|
|
|
+ List<String> paths = new ArrayList<>();
|
|
|
|
+ for (MultipartFile file : files) {
|
|
|
|
+ if(file !=null && file.getSize() >0){
|
|
|
|
+ String fileName = file.getOriginalFilename();
|
|
|
|
+ assert fileName != null;
|
|
|
|
+ String newFilePath = String.format(hotLocalPath,fdkkUploadRequest.getNum()) + "/"+fileName ;
|
|
|
|
+ File newFile = new File(newFilePath);
|
|
|
|
+ file.transferTo(newFile);
|
|
|
|
+ String path = newFile.getPath();
|
|
|
|
+ paths.add(path);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ FdkkResponse fdkkResponse = fdkkClient.uploadFiles(fdkkUploadRequest,paths,fdkkSceneService.getFdkkToken(token));
|
|
if(fdkkResponse.getCode() !=0){
|
|
if(fdkkResponse.getCode() !=0){
|
|
throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
|
|
throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
|
|
}
|
|
}
|