| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.CommonPage; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.entity.region.SccgRegion; |
| | |
| | | public CommonResult addRegion(@Validated @RequestBody SccgRegion sccgRegion) { |
| | | return CommonResult.success(iSccgRegionService.save(sccgRegion)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取行政区域分页查询") |
| | | @RequestMapping(value = "/list", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public CommonResult<IPage<SccgRegion>> list(@Validated @RequestBody SccgRegion sccgRegion) { |
| | | return CommonResult.success(iSccgRegionService.list(sccgRegion)); |
| | | public CommonResult<CommonPage<SccgRegion>> list(@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize, |
| | | @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) { |
| | | Page<SccgRegion> list = iSccgRegionService.list(pageSize, pageNum); |
| | | return CommonResult.success(CommonPage.restPage(list)); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation("获取子类") |
| | | @GetMapping("/getChildren/{parentId}") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "parentId",value = "顶级parentId=0") |
| | | @ApiImplicitParam(name = "parentId", value = "顶级parentId=0") |
| | | }) |
| | | public CommonResult<List<SccgRegion>> getChildren(@PathVariable Long parentId) { |
| | | List<SccgRegion> treeList = iSccgRegionService.getChildren(parentId); |