feat:更新上传文件接口
This commit is contained in:
@@ -34,9 +34,9 @@ public class FileController {
|
||||
|
||||
@Operation(summary = "上传aList文件")
|
||||
@PostMapping(value = "/alist", consumes = "multipart/form-data")
|
||||
public void uploadAListFile(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam("filePath") String filePath) {
|
||||
aListService.uploadFile(file, filePath);
|
||||
public String uploadAListFile(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam("filePath") String filePath) {
|
||||
return aListService.uploadFile(file, filePath);
|
||||
}
|
||||
|
||||
@Operation(summary = "上传文件块")
|
||||
|
||||
@@ -3,5 +3,5 @@ package com.cxx.home.service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
public interface AListService {
|
||||
void uploadFile(MultipartFile file, String filePath);
|
||||
String uploadFile(MultipartFile file, String filePath);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AListServiceImpl implements AListService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadFile(MultipartFile file, String filePath) {
|
||||
public String uploadFile(MultipartFile file, String filePath) {
|
||||
try {
|
||||
String token = getAccessToken();
|
||||
|
||||
@@ -81,6 +81,8 @@ public class AListServiceImpl implements AListService {
|
||||
|
||||
Files.deleteIfExists(compressFile.toPath());
|
||||
Files.deleteIfExists(tempFile.toPath());
|
||||
|
||||
return filePath;
|
||||
} catch (Exception e) {
|
||||
log.error("文件上传失败{}", e.getMessage());
|
||||
throw new RuntimeException("文件上传失败", e);
|
||||
|
||||
Reference in New Issue
Block a user