package com.ycl.controller.caseHandler; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ycl.api.CommonResult; import com.ycl.controller.BaseController; import com.ycl.entity.dict.DataDictionary; import com.ycl.service.dict.IDataDictionaryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** *

* 违规事件 前端控制器 *

* * @author wl * @since 2022-09-24 */ @RestController @RequestMapping("/violations") @Api(tags = "违规事项设置") public class ViolationsController extends BaseController { @Autowired IDataDictionaryService iDataDictionaryService; /** * @Description 查询违建类型 * @Param [size, current, keyWord] * @return com.ycl.api.CommonResult **/ @ApiOperation(value = "查询违规类型") @GetMapping("/query") public CommonResult searchIllegalBuilding(@RequestParam Integer size, @RequestParam Integer current, @RequestParam(required = false) String keyWord) { Page dataDictionaryPage = new Page<>(); dataDictionaryPage.setSize(size); dataDictionaryPage.setCurrent(current); return CommonResult.success(iDataDictionaryService.listViolations(dataDictionaryPage,keyWord)); } /** * @Description delete illegal building by id * @Param [id] * @return com.ycl.api.CommonResult **/ @ApiOperation(value = "删除违规类型") @DeleteMapping("/delete") public CommonResult removeIllegalBuilding(@RequestParam Integer id){ return CommonResult.success(iDataDictionaryService.removeById(id)); } }