| | |
| | | }) |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "懒加载列表", notes = "传入menu") |
| | | public R<List<RegionVO>> lazyTree(String parentCode, @ApiIgnore @RequestParam Map<String, Object> menu) { |
| | | public R<List<RegionVO>> lazyTree(String parentCode, @ApiIgnore @RequestParam Map<String, Object> menu,HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | List<RegionVO> list = regionService.lazyTree(parentCode, menu); |
| | | return R.data(RegionWrapper.build().listNodeLazyVO(list)); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自定义新增 行政区划表 |
| | | */ |
| | | @PostMapping("/saves") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "新增", notes = "传入region") |
| | | public R saves(@Valid @RequestBody Region region) { |
| | | int count = regionService.getByParentCodeCount(region.getParentCode()); |
| | | region.setCode(region.getParentCode()+count); |
| | | return R.status(regionService.save(region)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 行政区划表 |
| | | */ |
| | | @PostMapping("/update") |