小程序经纬度接口,临时主页接口

This commit is contained in:
张松
2025-02-14 14:39:15 +08:00
parent 0efbb1e747
commit b8f5448a7b
6 changed files with 387 additions and 1 deletions

View File

@@ -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;
}
}