| | |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.config.TengxunMapProperties; |
| | | import com.mzl.flower.dto.request.flower.FlowerCategoryQueryDTO; |
| | | import com.mzl.flower.dto.response.flower.*; |
| | | import com.mzl.flower.service.flower.FlowerCategoryService; |
| | |
| | | @Autowired |
| | | private FlowerCategoryService categoryService; |
| | | |
| | | @Autowired |
| | | private TengxunMapProperties tengxunMapProperties; |
| | | |
| | | @GetMapping("/category/price/ave") |
| | | @ApiOperation(value = "获取商品分类均价") |
| | | public ResponseEntity<ReturnDataDTO<List<FlowerCategoryDailyDTO>>> getHomeCategoryDaily(Page page){ |
| | |
| | | @GetMapping("/address/parse") |
| | | @ApiOperation(value = "解析经纬度") |
| | | public ResponseEntity<ReturnDataDTO<?>> getAddress(String location) throws Exception { |
| | | String requestPath = "https://apis.map.qq.com/ws/geocoder/v1/?key=GSBBZ-CJA3U-NNDVH-GE65N-6FIF6-ZGBCU&get_poi=1&location="; |
| | | String pp = URLEncoder.encode(location, "utf-8"); |
| | | requestPath += pp; |
| | | String key = tengxunMapProperties.getApiKey(); |
| | | String locationTmp = URLEncoder.encode(location, "utf-8"); |
| | | String requestPath = String.format("https://apis.map.qq.com/ws/geocoder/v1/?key=%s&get_poi=1&location=%s", key, locationTmp); |
| | | JSONObject json = HttpUtil.doRequest(HttpMethod.GET.name(), requestPath, "json", new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>()); |
| | | return returnData(R.SUCCESS.getCode(), json); |
| | | } |