青羊经侦大队-数据平台
wl
2022-07-25 2b278a1aa078b39d891f3eb00aac729ed2c1c5b3
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 = "获取案件的id和名称列表")
    @GetMapping("/getCauseIdAndName")
    @ApiResponse(message = "执行成功", code = 200)
    public R getCauseIdAndName() {
        return R.ok(causeService.getCauseIdAndName());
    }
}