kongdeqiang
2024-09-26 da9a4f7ad988c452f3a356989eaf7a6c06ae5032
src/main/java/com/boying/controller/ViolationTypeController.java
@@ -10,13 +10,14 @@
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("violationType")
@RequestMapping("ffzf/violationtype")
@RequiredArgsConstructor
public class ViolationTypeController {
    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());
    }