update 高德地图工具类

This commit is contained in:
Lemon
2023-06-16 16:08:17 +08:00
parent 1874808419
commit cea3464cdc
7 changed files with 151 additions and 34 deletions

View File

@@ -6,6 +6,7 @@ import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
@@ -19,22 +20,38 @@ import java.util.*;
/**
* 高德地图工具类
*/
@Component
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;
@Value("${aMap.merchantPrivateKey}")
private static String MERCHANT_PRIVATE_KEY;
public static void setMerchantPrivateKey(String merchantPrivateKey) {
AMapUtils.MERCHANT_PRIVATE_KEY = merchantPrivateKey;
}
@Value("${aMap.aMapPublicKey}")
private static String AMAP_PUBLIC_KEY;
public void setAmapPublicKey(String amapPublicKey) {
AMapUtils.AMAP_PUBLIC_KEY = amapPublicKey;
}
@Value("${aMap.appId}")
private static String APP_ID;
public void setAppId(String appId) {
AMapUtils.APP_ID = appId;
}
@Value("${aMap.devUrl}")
private static String DEV_URL;
public void setDevUrl(String devUrl) {
AMapUtils.DEV_URL = devUrl;
}
@Value("${aMap.prdUrl}")
private static String PRD_URL;
public void setPrdUrl(String prdUrl) {
AMapUtils.PRD_URL = prdUrl;
}
/**
* 使用商家私钥生成签名