From 2b278a1aa078b39d891f3eb00aac729ed2c1c5b3 Mon Sep 17 00:00:00 2001 From: wl <173@qq.com> Date: 星期一, 25 七月 2022 17:28:58 +0800 Subject: [PATCH] 报案人查询分页处理,处理案件早发时间 修改问题 --- src/main/java/com/example/jz/controller/CauseController.java | 12 ++++++++++-- 1 files changed, 10 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 f3c288e..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)); } @@ -132,5 +133,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