refactor: 修改uploadFile方法参数类型为File

- 将LsfxAnalysisClient.uploadFile方法参数从MultipartFile改为File
- 在LsfxTestController中添加MultipartFile到File的转换逻辑
- 使用临时文件处理转换,并在finally块中自动清理
This commit is contained in:
wkc
2026-03-05 12:01:16 +08:00
parent 190c7b096e
commit f1c43589d4
2 changed files with 31 additions and 5 deletions

View File

@@ -15,8 +15,8 @@ import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@@ -109,8 +109,8 @@ public class LsfxAnalysisClient {
/**
* 上传文件
*/
public UploadFileResponse uploadFile(Integer groupId, MultipartFile file) {
log.info("【流水分析】上传文件请求: groupId={}, fileName={}", groupId, file.getOriginalFilename());
public UploadFileResponse uploadFile(Integer groupId, File file) {
log.info("【流水分析】上传文件请求: groupId={}, fileName={}", groupId, file.getName());
long startTime = System.currentTimeMillis();
try {