| | |
| | | |
| | | @RestController |
| | | @RequestMapping("/region") |
| | | @Api("地区") |
| | | @Api(tags = "地区") |
| | | public class RegionController { |
| | | @Resource |
| | | private RegionService regionService; |
| | | |
| | | /** |
| | | * 获取省份列表 |
| | | * 省市区级联 |
| | | */ |
| | | @GetMapping("/getProvinceList") |
| | | @ApiOperation("获取省份列表") |
| | | public R<List<Region>> getProvinceList() { |
| | | @ApiOperation("省市区级联") |
| | | public R<List<Region>> getProvinceList(@ApiParam("父级id") @RequestParam Long parentId) { |
| | | return R.ok(regionService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId, 0))); |
| | | .eq(Region::getParentId, parentId))); |
| | | } |
| | | |
| | | /** |
| | | * 获取下级地区列表 |
| | | */ |
| | | @GetMapping("/getNextRegionList") |
| | | @ApiOperation("获取下级地区列表") |
| | | public R<List<Region>> getNextRegionList(@ApiParam("父级id") @RequestParam Long id) { |
| | | return R.ok(regionService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId, id))); |
| | | } |
| | | } |