小程序经纬度接口,临时主页接口
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
package com.czg.utils;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Component
|
||||
public class GeoUtil {
|
||||
// 地球半径,单位:公里
|
||||
private static final double EARTH_RADIUS = 6371.0;
|
||||
@@ -30,4 +37,5 @@ public class GeoUtil {
|
||||
// 计算距离(米)
|
||||
return EARTH_RADIUS * c * 1000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user