feat:更新上传文件接口
This commit is contained in:
@@ -34,9 +34,9 @@ public class FileController {
|
|||||||
|
|
||||||
@Operation(summary = "上传aList文件")
|
@Operation(summary = "上传aList文件")
|
||||||
@PostMapping(value = "/alist", consumes = "multipart/form-data")
|
@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) {
|
@RequestParam("filePath") String filePath) {
|
||||||
aListService.uploadFile(file, filePath);
|
return aListService.uploadFile(file, filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "上传文件块")
|
@Operation(summary = "上传文件块")
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ package com.cxx.home.service;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
public interface AListService {
|
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
|
@Override
|
||||||
public void uploadFile(MultipartFile file, String filePath) {
|
public String uploadFile(MultipartFile file, String filePath) {
|
||||||
try {
|
try {
|
||||||
String token = getAccessToken();
|
String token = getAccessToken();
|
||||||
|
|
||||||
@@ -81,6 +81,8 @@ public class AListServiceImpl implements AListService {
|
|||||||
|
|
||||||
Files.deleteIfExists(compressFile.toPath());
|
Files.deleteIfExists(compressFile.toPath());
|
||||||
Files.deleteIfExists(tempFile.toPath());
|
Files.deleteIfExists(tempFile.toPath());
|
||||||
|
|
||||||
|
return filePath;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("文件上传失败{}", e.getMessage());
|
log.error("文件上传失败{}", e.getMessage());
|
||||||
throw new RuntimeException("文件上传失败", e);
|
throw new RuntimeException("文件上传失败", e);
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ spring:
|
|||||||
name: @project.artifactId@
|
name: @project.artifactId@
|
||||||
version: @project.version@
|
version: @project.version@
|
||||||
profiles:
|
profiles:
|
||||||
active: docker
|
active: dev
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 500MB
|
||||||
|
max-request-size: 500MB
|
||||||
mail:
|
mail:
|
||||||
host: smtp.163.com
|
host: smtp.163.com
|
||||||
port: 465
|
port: 465
|
||||||
@@ -29,7 +33,7 @@ mybatis-plus:
|
|||||||
mapper-locations: classpath*:/mapper/**/*.xml
|
mapper-locations: classpath*:/mapper/**/*.xml
|
||||||
configuration:
|
configuration:
|
||||||
log-impl:
|
log-impl:
|
||||||
org.apache.ibatis.logging.stdout.StdOutImpl
|
# org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
||||||
web-starter:
|
web-starter:
|
||||||
base-package: com.cxx.home
|
base-package: com.cxx.home
|
||||||
|
|||||||
Reference in New Issue
Block a user