|
@@ -67,7 +67,8 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
|
|
|
private SSOLoginHelper ssoLoginHelper;
|
|
|
|
|
|
@Override
|
|
|
- public String uploads(String imgData,String fileName,String blzType,MultipartFile[] files,String sceneCode,Integer type,String token) throws Exception{
|
|
|
+ public String uploads(String imgData,String fileName,String blzType,MultipartFile[] files,
|
|
|
+ String sceneCode,Integer type,String token, String uploadPath) throws Exception{
|
|
|
SSOUser ssoUser = ssoLoginHelper.loginCheck(token);
|
|
|
Long userId = ssoUser == null ? null :ssoUser.getId();
|
|
|
|
|
@@ -79,7 +80,7 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
|
|
|
if(files !=null && files.length >0){
|
|
|
multipartFiles.addAll(Arrays.asList(files));
|
|
|
}
|
|
|
- return this.uploadFiles(fileName,blzType,multipartFiles,sceneCode,type,userId);
|
|
|
+ return this.uploadFiles(fileName,blzType,multipartFiles,sceneCode,type,userId,uploadPath);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -107,7 +108,8 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
- public String uploadFiles(String sendFileName,String bizType,List<MultipartFile> files, String sceneCode, Integer type,Long userId) throws Exception{
|
|
|
+ public String uploadFiles(String sendFileName,String bizType,List<MultipartFile> files,
|
|
|
+ String sceneCode, Integer type,Long userId, String uploadPath) throws Exception{
|
|
|
if (StrUtil.isEmpty(sceneCode))
|
|
|
throw new BusinessException(ServerCode.PARAM_REQUIRED, "num");
|
|
|
if(CollUtil.isEmpty(files))
|
|
@@ -129,7 +131,7 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
|
|
|
if(files.size() ==1 && StringUtils.isNotBlank(sendFileName)){
|
|
|
realFileName = sendFileName ;
|
|
|
}
|
|
|
- String ossPath = String.format(UploadFilePath.USER_EDIT_PATH ,sceneCode) + realFileName;
|
|
|
+ String ossPath = StrUtil.isNotBlank(uploadPath) ? uploadPath : (String.format(UploadFilePath.USER_EDIT_PATH ,sceneCode) + realFileName);
|
|
|
try {
|
|
|
uploadToOssUtil.upload2(newFile.getPath(),ossPath);
|
|
|
}catch (Exception e){
|