kongdeqiang
2024-12-04 80cacfd0dcee0174f2a8d9ae322a2fcf857cef63
src/main/java/com/boying/controller/ViolationTypeController.java
@@ -17,6 +17,7 @@
    private final ViolationTypeService violationTypeService;
    @PostMapping("/findPage")
    //@Operation(summary = "分页查询" , description = "分页查询" )
    public Object findPage(Page page) {
        QueryWrapper<ViolationType> wrapper = new QueryWrapper<>();
        wrapper.lambda()
@@ -25,23 +26,27 @@
    }
    @PostMapping("/save")
   // @Operation(summary = "新增违章类型" , description = "新增违章类型" )
    public Object save(ViolationType violationType) {
        violationTypeService.saveOrUpdate(violationType);
        return R.ok("保存成功");
    }
    @GetMapping("/{id}")
   // @Operation(summary = "根据id查询" , description = "根据id查询" )
    public Object getObj(@PathVariable Integer id) {
        return R.ok(violationTypeService.getById(id));
    }
    @PostMapping("/delete")
   // @Operation(summary = "删除违章类型" , description = "删除违章类型" )
    public Object delete(Long id) {
        violationTypeService.removeById(id);
        return R.ok("删除成功");
    }
    @PostMapping("/findAll")
    //@Operation(summary = "查询所有" , description = "查询所有" )
    public Object findAll() {
        return R.ok(violationTypeService.list());
    }