mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 20:45:10 +08:00
update 高德推送动态数据
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package com.jsowell.thirdparty.amap.util;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.jsowell.common.util.id.SnUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -29,6 +32,8 @@ public class AMapUtils {
|
||||
// private static String PRD_URL;
|
||||
private static String API_URL;
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(AMapUtils.class);
|
||||
|
||||
@Value("${aMap.merchantPrivateKey}")
|
||||
public void setMerchantPrivateKey(String merchantPrivateKey) {
|
||||
AMapUtils.MERCHANT_PRIVATE_KEY = merchantPrivateKey;
|
||||
@@ -114,7 +119,8 @@ public class AMapUtils {
|
||||
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);
|
||||
logger.info("高德返回结果:{}", respObj);
|
||||
// System.out.println("高德返回结果:" + respObj);
|
||||
return JSONObject.toJSONString(respObj);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user