| | |
| | | |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.service.district.DistrictService; |
| | | import com.mzl.flower.service.district.DistrictTengxunService; |
| | | import com.mzl.flower.service.system.ProvinceService; |
| | | import com.mzl.flower.utils.LocalUtil; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @Autowired |
| | | private ProvinceService provinceService; |
| | | |
| | | /** |
| | | * 腾讯地图获取中国省市区数据 |
| | | */ |
| | | @Autowired |
| | | private DistrictTengxunService districtTengxunService; |
| | | |
| | | /** |
| | | * 高德地图获取中国省市区数据 |
| | | */ |
| | | @Autowired |
| | | private DistrictService districtService; |
| | | |
| | | @ApiOperation(value = "获取省份") |
| | | @GetMapping("/provinces") |
| | |
| | | @ApiOperation(value = "获取中国省市区数据") |
| | | @GetMapping("/area/json") |
| | | public ResponseEntity<String> getChineseArea() { |
| | | return returnData(R.SUCCESS.getCode(), provinceService.getChineseArea()); |
| | | |
| | | // 高德地图 |
| | | // return returnData(R.SUCCESS.getCode(), districtService.getChineseArea()); |
| | | // 腾讯地图 |
| | | return returnData(R.SUCCESS.getCode(), districtTengxunService.getChineseArea()); |
| | | // return returnData(R.SUCCESS.getCode(), provinceService.getChineseArea()); |
| | | } |
| | | |
| | | @ApiOperation(value = "刷新中国省市区数据缓存") |
| | | @GetMapping("/area/json/refresh") |
| | | public ResponseEntity<String> refresh() { |
| | | provinceService.refreshChineseData(); |
| | | // provinceService.refreshChineseData(); |
| | | // districtService.clearChineseDataCache(); |
| | | districtTengxunService.clearChineseDataCache(); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | } |