更新新增三个模块

This commit is contained in:
super
2026-03-22 11:20:09 +08:00
parent c80e1889ef
commit 497d65d41d
96 changed files with 5393 additions and 588 deletions
@@ -46,8 +46,9 @@ public class FileUploadController {
})
public ApiResponse<UploadFileVo> upload(
@Parameter(name = "file", description = "待上传的 Excel 或业务源文件", required = true, in = ParameterIn.QUERY)
MultipartFile file) throws Exception {
return ApiResponse.success(localFileStorageService.saveTempFile(file));
MultipartFile file,
@RequestParam(required = false) String relativePath) throws Exception {
return ApiResponse.success(localFileStorageService.saveTempFile(file, relativePath));
}
@GetMapping("/excel-info")
@@ -18,4 +18,7 @@ public class UploadFileVo {
@Schema(description = "文件大小")
private Long size;
@Schema(description = "相对上传目录路径")
private String relativePath;
}
@@ -29,7 +29,7 @@ public class LocalFileStorageService {
private final StorageProperties storageProperties;
public UploadFileVo saveTempFile(MultipartFile file) throws IOException {
public UploadFileVo saveTempFile(MultipartFile file, String relativePath) throws IOException {
File tempDir = FileUtil.file(storageProperties.getLocalTempDir());
File parentDir = tempDir.getParentFile();
if (parentDir != null) {
@@ -46,6 +46,7 @@ public class LocalFileStorageService {
vo.setOriginalFilename(file.getOriginalFilename());
vo.setLocalPath(target.getAbsolutePath());
vo.setSize(file.getSize());
vo.setRelativePath(relativePath);
return vo;
}