| | |
| | | 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() |
| | |
| | | } |
| | | |
| | | @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()); |
| | | } |