Pu Zhibing
2024-12-13 73b750200f25df08aa64124da49e7461f9de6653
DriverNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDMapGeocodingUtil.java
@@ -20,7 +20,7 @@
@Component
public class GDMapGeocodingUtil {
    private String key = "c473445a931ee8c42eef8b63fc3602c5";
    private String key = "8fc6a7da12d64696e9727605d81f72de";
    @Autowired
    private RestTemplate restTemplate;
@@ -86,9 +86,12 @@
     */
    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;
        System.err.println("=========="+lon+"============"+lan);
        String forObject = restTemplate.getForObject(url, String.class);
        JSONObject jsonObject = JSON.parseObject(forObject);
        Map<String, String> map = new HashMap<>();
        System.err.println("=========="+jsonObject);
//        gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/regeo", "经纬度转行政区域");