|
@@ -12,7 +12,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.core.io.InputStreamResource;
|
|
import org.springframework.core.io.InputStreamResource;
|
|
-import org.springframework.http.ContentDisposition;
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -24,7 +23,6 @@ import java.io.IOException;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
-import java.util.Base64;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -47,9 +45,9 @@ public class FileMangerController {
|
|
// return Response.success(insertIds);
|
|
// return Response.success(insertIds);
|
|
// }
|
|
// }
|
|
|
|
|
|
- @PostMapping("/uploadFile")
|
|
|
|
- @Operation(summary = "上传文件")
|
|
|
|
- public String uploadFile(@RequestBody List<MultipartFile> files, Integer sourceId) throws IOException {
|
|
|
|
|
|
+ @PostMapping("/uploadNormalFile")
|
|
|
|
+ @Operation(summary = "上传普通文件")
|
|
|
|
+ public String uploadNormalFile(@RequestBody List<MultipartFile> files, Integer sourceId) throws IOException {
|
|
if(files != null && files.size() != 0){
|
|
if(files != null && files.size() != 0){
|
|
List<Integer> insertIds = fileManagerService.uploadFile(files, sourceId);
|
|
List<Integer> insertIds = fileManagerService.uploadFile(files, sourceId);
|
|
if(insertIds != null && insertIds.size() != 0){
|
|
if(insertIds != null && insertIds.size() != 0){
|
|
@@ -60,8 +58,21 @@ public class FileMangerController {
|
|
} else {
|
|
} else {
|
|
return Response.error("上传文件不能为空");
|
|
return Response.error("上传文件不能为空");
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
|
|
|
+ @PostMapping("/uploadPatentFile")
|
|
|
|
+ @Operation(summary = "上传专利文件")
|
|
|
|
+ public String uploadPatentFile(@RequestBody List<MultipartFile> files, Integer sourceId) throws IOException {
|
|
|
|
+ if(files != null && files.size() != 0){
|
|
|
|
+ List<Integer> insertIds = fileManagerService.uploadFile(files, sourceId);
|
|
|
|
+ if(insertIds != null && insertIds.size() != 0){
|
|
|
|
+ return Response.success("上传文件成功,文件信息id为" + insertIds);
|
|
|
|
+ } else {
|
|
|
|
+ return Response.error("文件信息入表失败");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return Response.error("上传文件不能为空");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// @GetMapping("/downloadSystemFile")
|
|
// @GetMapping("/downloadSystemFile")
|