From 043736a7acef00a03fb15744406bfef555ad31eb Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期二, 19 七月 2022 15:27:05 +0800
Subject: [PATCH] 案件录入导入细节修改
---
src/main/java/com/example/jz/controller/CauseController.java | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/example/jz/controller/CauseController.java b/src/main/java/com/example/jz/controller/CauseController.java
index fbe2d62..a5cde56 100644
--- a/src/main/java/com/example/jz/controller/CauseController.java
+++ b/src/main/java/com/example/jz/controller/CauseController.java
@@ -8,16 +8,18 @@
import com.example.jz.modle.dto.AddReportDto;
import com.example.jz.modle.dto.CauseDto;
import com.example.jz.modle.dto.ReportParamDto;
-import com.example.jz.modle.entity.Report;
import com.example.jz.modle.vo.ReportListVo;
import com.example.jz.service.CauseService;
import com.example.jz.service.ReportService;
-import com.example.jz.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
+import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
/**
* 妗堜欢琛�(Cause)琛ㄦ帶鍒跺眰
@@ -27,11 +29,12 @@
*/
@RestController
@RequestMapping("cause")
-@Api(tags = "妗堜欢鍖�")
+@Api(tags = "妗堜欢鍖�-妗堜欢褰曞叆")
public class CauseController extends ApiController {
/**
* 鏈嶅姟瀵硅薄
*/
+ @Resource
private CauseService causeService;
private ReportService reportService;
@@ -98,6 +101,15 @@
return R.ok();
}
+ @ApiOperation(httpMethod = "POST", value = "妗堜欢瀵煎叆")
+ @PostMapping("/upload")
+ @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
+ @SneakyThrows
+ public R upload(@RequestParam(value = "multipartFile") MultipartFile multipartFile) {
+ causeService.loadFile(multipartFile);
+ return R.ok();
+ }
+
@ApiOperation(httpMethod = "GET", value = "鏍规嵁缇ょ粍id鏌ヨ妗堜欢鍒嗛〉")
@GetMapping("/getAllReportList")
@ApiResponse(message = "鎵ц鎴愬姛", code = 200)
--
Gitblit v1.8.0