From 8a92712c881f3b487d926fe4638ff94bd414e4c1 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期二, 26 七月 2022 10:05:20 +0800
Subject: [PATCH] 报案人是否进群

---
 src/main/java/com/example/jz/controller/CauseController.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/example/jz/controller/CauseController.java b/src/main/java/com/example/jz/controller/CauseController.java
index 55f3170..39e636c 100644
--- a/src/main/java/com/example/jz/controller/CauseController.java
+++ b/src/main/java/com/example/jz/controller/CauseController.java
@@ -16,6 +16,7 @@
 import io.swagger.annotations.ApiResponse;
 import lombok.SneakyThrows;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -52,7 +53,7 @@
     @ApiOperation(httpMethod = "POST", value = "妗堜欢鍙�-妗堜欢褰曞叆-娣诲姞妗堜欢")
     @PostMapping("/addCause")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
-    public R addCause(@RequestBody CauseDto causeDto) {
+    public R addCause(@RequestBody @Validated CauseDto causeDto) {
         causeService.addCause(causeDto);
         return R.ok();
     }
@@ -60,7 +61,7 @@
     @ApiOperation(httpMethod = "PUT", value = "妗堜欢鍙�-妗堜欢褰曞叆-淇敼妗堜欢")
     @PutMapping("/updateCause")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
-    public R updateCause(@RequestBody CauseDto causeDto, Integer id) {
+    public R updateCause(@RequestBody @Validated CauseDto causeDto, Integer id) {
         return R.ok(causeService.updateCause(causeDto, id));
     }
 

--
Gitblit v1.8.0