cloudroam
2025-05-29 5cdc843d9fce09488f11a8355b10f58976860446
src/main/java/com/mzl/flower/web/customer/HomeCustomerController.java
@@ -5,6 +5,7 @@
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;
@@ -39,6 +40,9 @@
    @Autowired
    private FlowerCategoryService categoryService;
    @Autowired
    private TengxunMapProperties tengxunMapProperties;
    @GetMapping("/category/price/ave")
    @ApiOperation(value = "获取商品分类均价")
    public ResponseEntity<ReturnDataDTO<List<FlowerCategoryDailyDTO>>> getHomeCategoryDaily(Page page){
@@ -48,9 +52,9 @@
    @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);
    }