From aa43a92c7ec9053dbaef92fe5ccb3011b670442c Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 12 七月 2023 11:46:21 +0800 Subject: [PATCH] 更新线上视频奖励模块接口 --- cloud-server-account/src/main/java/com/dsh/account/util/GDMapGeocodingUtil.java | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/util/GDMapGeocodingUtil.java b/cloud-server-account/src/main/java/com/dsh/account/util/GDMapGeocodingUtil.java index c9d9dc7..a260b46 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/util/GDMapGeocodingUtil.java +++ b/cloud-server-account/src/main/java/com/dsh/account/util/GDMapGeocodingUtil.java @@ -28,9 +28,6 @@ private String key = "fb131ad2dbfb3f39d7d37d244b92aa2d"; - @Autowired - private HttpClientUtil httpClientUtil; - /** * 将行政区域名称转化为坐标 @@ -60,12 +57,10 @@ String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON"; url += "&address=" + province + (ToolUtil.isNotEmpty(city) ? city : "") + (ToolUtil.isNotEmpty(county) ? county : "") + (ToolUtil.isNotEmpty(address) ? address : ""); - HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "json"); + HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); JSONObject jsonObject = JSON.parseObject(httpResult.getData()); String status = jsonObject.getString("status"); List<String> list = new ArrayList<>(); - -// gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/geo", "行政区域转经纬度"); if(status.equals("1")){ JSONArray geocodes = jsonObject.getJSONArray("geocodes"); @@ -84,12 +79,10 @@ public Map<String, Object> geocoding(String address) throws Exception{ Map<String, Object> map = new HashMap<>(); String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON&address=" + address; - HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "json"); + HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); JSONObject jsonObject = JSON.parseObject(httpResult.getData()); String status = jsonObject.getString("status"); List<String> list = new ArrayList<>(); - -// gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/geo", "行政区域转经纬度"); if(status.equals("1")){ JSONArray geocodes = jsonObject.getJSONArray("geocodes"); @@ -114,11 +107,9 @@ */ public Map<String, String> geocode(String lon, String lan) throws Exception{ String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan; - HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "json"); + HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); JSONObject jsonObject = JSON.parseObject(httpResult.getData()); Map<String, String> map = new HashMap<>(); - -// gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/regeo", "经纬度转行政区域"); if(jsonObject.getString("status").equals("1")){ JSONObject regeocode = jsonObject.getJSONObject("regeocode"); @@ -149,7 +140,7 @@ */ public Map<String, String> convert(String locations, String coordsys) throws Exception{ String url = "https://restapi.amap.com/v3/assistant/coordinate/convert?locations=" + locations + "&coordsys=" + coordsys + "&output=json&key=" + key; - HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "json"); + HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); JSONObject jsonObject = JSON.parseObject(httpResult.getData()); Map<String, String> map = new HashMap<>(); if("1".equals(jsonObject.getString("status"))){ -- Gitblit v1.7.1