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,
|
||||
public String uploadAListFile(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam("filePath") String filePath) {
|
||||
aListService.uploadFile(file, 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);
|
||||
|
||||
@@ -6,7 +6,11 @@ spring:
|
||||
name: @project.artifactId@
|
||||
version: @project.version@
|
||||
profiles:
|
||||
active: docker
|
||||
active: dev
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 500MB
|
||||
max-request-size: 500MB
|
||||
mail:
|
||||
host: smtp.163.com
|
||||
port: 465
|
||||
@@ -29,7 +33,7 @@ mybatis-plus:
|
||||
mapper-locations: classpath*:/mapper/**/*.xml
|
||||
configuration:
|
||||
log-impl:
|
||||
org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
web-starter:
|
||||
base-package: com.cxx.home
|
||||
|
||||
Reference in New Issue
Block a user