完成上传功能的前端页面

This commit is contained in:
2022-07-07 23:04:41 +08:00
parent d016624190
commit a3a40fe5d0
2 changed files with 18 additions and 7 deletions
@@ -11,7 +11,7 @@ public class ResultDTO<T> {
private boolean success;
private int code;
private T data;
private String msg;
private String message;
public ResultDTO() {
}
@@ -25,18 +25,18 @@ public class ResultDTO<T> {
this.success = success;
this.code = code;
this.data = data;
this.msg = msg;
this.message = msg;
}
public ResultDTO(boolean success, int code, String msg) {
this.success = success;
this.code = code;
this.msg = msg;
this.message = msg;
}
public ResultDTO(boolean success, String msg) {
this.success = success;
this.msg = msg;
this.message = msg;
}
public boolean isSuccess() {
@@ -1,5 +1,6 @@
package com.aos.fileidentify.controller;
import com.aos.fileidentify.common.ResultDTO;
import com.aos.fileidentify.service.FileIdentifyService;
import org.springframework.web.bind.annotation.PostMapping;
@@ -28,7 +29,9 @@ import lombok.AllArgsConstructor;
@AllArgsConstructor
public class FileIdentifyController {
/** File identify service */
/**
* File identify service
*/
private final FileIdentifyService fileIdentifyService;
@@ -40,8 +43,12 @@ public class FileIdentifyController {
*/
@ApiOperation(value = "pdf文件解析服务")
@PostMapping(value = "/pdf")
public void identifyPdf(@RequestPart("pdf") MultipartFile file) {
public ResultDTO identifyPdf(@RequestPart("pdf") MultipartFile file) {
this.fileIdentifyService.processPdf(file);
return ResultDTO.builder()
.code(20000)
.message("操作成功")
.build();
}
@@ -53,8 +60,12 @@ public class FileIdentifyController {
*/
@ApiOperation(value = "excel文件解析服务")
@PostMapping(value = "/excel")
public void identifyExcel(@RequestPart("excel") MultipartFile file) {
public ResultDTO identifyExcel(@RequestPart("excel") MultipartFile file) {
this.fileIdentifyService.processExcel(file);
return ResultDTO.builder()
.code(20000)
.message("操作成功")
.build();
}
}