mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
添加高德地图相关配置
This commit is contained in:
@@ -30,6 +30,12 @@ public class AMapUtils {
|
||||
@Value("${aMap.appId}")
|
||||
private static String APP_ID;
|
||||
|
||||
@Value("${aMap.devUrl}")
|
||||
private static String DEV_URL;
|
||||
|
||||
@Value("${aMap.prdUrl}")
|
||||
private static String PRD_URL;
|
||||
|
||||
/**
|
||||
* 使用商家私钥生成签名
|
||||
*
|
||||
@@ -81,9 +87,8 @@ public class AMapUtils {
|
||||
// 线下联调环境:https://restapi.amap.com/rest/openmp/devgw?key=高德云店秘钥key
|
||||
// 线上环境:https://restapi.amap.com/rest/openmp/gw?key=高德云店秘钥key
|
||||
// 高德云店秘钥key请登录高德云店「接入准备及配置」页面查看
|
||||
String url = "https://restapi.amap.com/rest/openmp/devgw?key=77ff5350723d29901fa859515f553644";
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> resp = restTemplate.postForEntity(url, entity, String.class);
|
||||
ResponseEntity<String> resp = restTemplate.postForEntity(DEV_URL, entity, String.class);
|
||||
if (resp.getBody() != null && !"".equals(resp.getBody())) {
|
||||
JSONObject respObj = JSONObject.parseObject(resp.getBody());
|
||||
System.out.println("高德返回结果:" + respObj);
|
||||
|
||||
Reference in New Issue
Block a user