fix:生成报告
This commit is contained in:
@@ -486,8 +486,8 @@ public class DataFileController implements IDataFeignClient {
|
||||
*/
|
||||
@PostMapping("/downloadFileToLocal")
|
||||
@Operation(summary = "下载文件到本地临时目录", description = "下载文件到本地临时目录")
|
||||
public void downloadFileToLocal(@RequestParam(value = "fileId") @Validated Long fileId, @RequestParam(value = "path") @Validated String path) {
|
||||
IDataFileService.downloadFileToLocal(fileId,path);
|
||||
public SdmResponse downloadFileToLocal(@RequestParam(value = "fileId") @Validated Long fileId, @RequestParam(value = "path") @Validated String path) {
|
||||
return IDataFileService.downloadFileToLocal(fileId,path);
|
||||
}
|
||||
|
||||
@PostMapping("/downloadFolderToLocal")
|
||||
|
||||
@@ -366,7 +366,7 @@ public interface IDataFileService {
|
||||
* @param fileId 文件id
|
||||
* @param basePath 临时目录路径
|
||||
*/
|
||||
void downloadFileToLocal(Long fileId,String basePath);
|
||||
SdmResponse downloadFileToLocal(Long fileId,String basePath);
|
||||
|
||||
/**
|
||||
* 批量下载指定文件夹到本地目录
|
||||
|
||||
@@ -3001,7 +3001,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadFileToLocal(Long fileId, String basePath) {
|
||||
public SdmResponse downloadFileToLocal(Long fileId, String basePath) {
|
||||
if (fileId == null || basePath == null) {
|
||||
throw new RuntimeException("参数不能为空");
|
||||
}
|
||||
@@ -3040,7 +3040,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
}
|
||||
|
||||
return SdmResponse.success(targetFile.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("下载文件失败,fileId={}, basePath={}, fileName={}",
|
||||
fileId, basePath, originalName, e);
|
||||
|
||||
@@ -1566,10 +1566,10 @@ public class SystemFileIDataFileServiceImpl implements IDataFileService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadFileToLocal(Long fileId,String downloadPath) {
|
||||
public SdmResponse downloadFileToLocal(Long fileId,String downloadPath) {
|
||||
if (StringUtils.isNotBlank(downloadPath) && downloadPath.contains("..")) {
|
||||
log.error(downloadPath + "非法文件路径!");
|
||||
return;
|
||||
return SdmResponse.failed("非法文件路径");
|
||||
}
|
||||
String path = Tools.getRootPath(rootPath, String.valueOf(ThreadLocalContext.getTenantId())) + File.separator + downloadPath;
|
||||
File file = new File(path);
|
||||
@@ -1591,6 +1591,7 @@ public class SystemFileIDataFileServiceImpl implements IDataFileService {
|
||||
} catch (IOException e) {
|
||||
log.error("下载文件失败:" + e);
|
||||
}
|
||||
return SdmResponse.success(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -131,6 +131,8 @@ security:
|
||||
- /data/initNewTenant
|
||||
- /data/getMinioPresignedUrl
|
||||
- /data/getPublicDownloadUrl
|
||||
- /data/updatePermission
|
||||
- /data/createDir
|
||||
|
||||
data:
|
||||
storage-monitor:
|
||||
|
||||
@@ -131,6 +131,8 @@ security:
|
||||
- /data/initNewTenant
|
||||
- /data/getMinioPresignedUrl
|
||||
- /data/getPublicDownloadUrl
|
||||
- /data/updatePermission
|
||||
- /data/createDir
|
||||
|
||||
data:
|
||||
storage-monitor:
|
||||
|
||||
@@ -136,6 +136,8 @@ security:
|
||||
- /data/initNewTenant
|
||||
- /data/getMinioPresignedUrl
|
||||
- /data/getPublicDownloadUrl
|
||||
- /data/updatePermission
|
||||
- /data/createDir
|
||||
|
||||
data:
|
||||
storage-monitor:
|
||||
|
||||
@@ -131,6 +131,8 @@ security:
|
||||
- /data/initNewTenant
|
||||
- /data/getMinioPresignedUrl
|
||||
- /data/getPublicDownloadUrl
|
||||
- /data/updatePermission
|
||||
- /data/createDir
|
||||
|
||||
data:
|
||||
storage-monitor:
|
||||
|
||||
Reference in New Issue
Block a user