mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 高德
This commit is contained in:
@@ -25,8 +25,9 @@ public class AMapUtils {
|
||||
private static String MERCHANT_PRIVATE_KEY;
|
||||
private static String AMAP_PUBLIC_KEY;
|
||||
private static String APP_ID;
|
||||
private static String DEV_URL;
|
||||
private static String PRD_URL;
|
||||
// private static String DEV_URL;
|
||||
// private static String PRD_URL;
|
||||
private static String API_URL;
|
||||
|
||||
@Value("${aMap.merchantPrivateKey}")
|
||||
public void setMerchantPrivateKey(String merchantPrivateKey) {
|
||||
@@ -43,14 +44,19 @@ public class AMapUtils {
|
||||
AMapUtils.APP_ID = appId;
|
||||
}
|
||||
|
||||
@Value("${aMap.devUrl}")
|
||||
public void setDevUrl(String devUrl) {
|
||||
AMapUtils.DEV_URL = devUrl;
|
||||
}
|
||||
// @Value("${aMap.devUrl}")
|
||||
// public void setDevUrl(String devUrl) {
|
||||
// AMapUtils.DEV_URL = devUrl;
|
||||
// }
|
||||
|
||||
@Value("${aMap.prdUrl}")
|
||||
public void setPrdUrl(String prdUrl) {
|
||||
AMapUtils.PRD_URL = prdUrl;
|
||||
// @Value("${aMap.prdUrl}")
|
||||
// public void setPrdUrl(String prdUrl) {
|
||||
// AMapUtils.PRD_URL = prdUrl;
|
||||
// }
|
||||
|
||||
@Value("${aMap.apiUrl}")
|
||||
public void setApiUrl(String apiUrl) {
|
||||
AMapUtils.API_URL = apiUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +111,7 @@ public class AMapUtils {
|
||||
// 线上环境:https://restapi.amap.com/rest/openmp/gw?key=高德云店秘钥key
|
||||
// 高德云店秘钥key请登录高德云店「接入准备及配置」页面查看
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> resp = restTemplate.postForEntity(DEV_URL, entity, String.class);
|
||||
ResponseEntity<String> resp = restTemplate.postForEntity(API_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