From a800938e10736b81762cd98e207600690d7044b5 Mon Sep 17 00:00:00 2001
From: 安瑾然 <107107765@qq.com>
Date: 星期四, 21 七月 2022 17:37:54 +0800
Subject: [PATCH] commit

---
 src/main/java/com/example/jz/controller/CauseController.java |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 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..55f3170 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;
 
@@ -46,7 +49,7 @@
     }
 
 
-    @ApiOperation(httpMethod = "POST", value = "娣诲姞妗堜欢")
+    @ApiOperation(httpMethod = "POST", value = "妗堜欢鍙�-妗堜欢褰曞叆-娣诲姞妗堜欢")
     @PostMapping("/addCause")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R addCause(@RequestBody CauseDto causeDto) {
@@ -54,7 +57,7 @@
         return R.ok();
     }
 
-    @ApiOperation(httpMethod = "PUT", value = "淇敼妗堜欢")
+    @ApiOperation(httpMethod = "PUT", value = "妗堜欢鍙�-妗堜欢褰曞叆-淇敼妗堜欢")
     @PutMapping("/updateCause")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R updateCause(@RequestBody CauseDto causeDto, Integer id) {
@@ -62,39 +65,48 @@
     }
 
 
-    @ApiOperation(httpMethod = "GET", value = "妗堜欢褰曞叆鍒楄〃")
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-妗堜欢褰曞叆鍒楄〃")
     @GetMapping("/getCauseList")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R getCauseList(String cause, Integer status, Integer size, Integer current) {
         return R.ok(causeService.getCauserListByCondition(cause, status, size, current));
     }
 
-    @ApiOperation(httpMethod = "GET", value = "璐熻矗浜烘煡璇�")
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-璐熻矗浜烘煡璇�")
     @GetMapping("/getManagerList")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R getManagerList() {
         return R.ok(causeService.getManagerList());
     }
 
-    @ApiOperation(httpMethod = "GET", value = "鑾峰彇鎶ユ浜哄憳")
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-鑾峰彇妗堜欢鎶ユ浜哄憳")
     @GetMapping("/getReporterList")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R getReporterList(Integer causeId) {
         return R.ok(causeService.getReporterList(causeId));
     }
 
-    @ApiOperation(httpMethod = "GET", value = "鑾峰彇妗堜欢缇ゅ叕鍛�")
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-鑾峰彇妗堜欢缇ゅ叕鍛�")
     @GetMapping("/getGroupAnnouncement")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R getGroupAnnouncement(Integer groupId) {
         return R.ok(causeService.getGroupAnnouncement(groupId));
     }
 
-    @ApiOperation(httpMethod = "DELETE", value = "妗堜欢鍒犻櫎")
+    @ApiOperation(httpMethod = "DELETE", value = "妗堜欢鍙�-妗堜欢褰曞叆-妗堜欢鍒犻櫎")
     @DeleteMapping("/deleteCause")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R deleteCause(@RequestParam(value = "id") Integer id) {
         causeService.deleteCause(id);
+        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();
     }
 
@@ -120,5 +132,12 @@
         }
         return R.ok(causeService.addReportPeople(addReportDto));
     }
+
+    @ApiOperation(httpMethod = "GET", value = "鑾峰彇妗堜欢鐨刬d鍜屽悕绉板垪琛�")
+    @GetMapping("/getCauseIdAndName")
+    @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
+    public R getCauseIdAndName() {
+        return R.ok(causeService.getCauseIdAndName());
+    }
 }
 

--
Gitblit v1.8.0