小程序经纬度接口,临时主页接口
This commit is contained in:
@@ -54,7 +54,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
// 重置根路径,防止satoken切割根路径导致匹配不到路径
|
||||
ApplicationInfo.routePrefix = "";
|
||||
|
||||
SaRouter.match("/user/**").notMatch("/user/login", "/user/test")
|
||||
SaRouter.match("/user/**").notMatch("/user/login", "/user/test", "/user/geo/**", "/user/home/**")
|
||||
.check(r -> StpKit.USER.checkMiniUser())
|
||||
.setHit(true)
|
||||
// .match("/**")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public interface GeoService {
|
||||
Object getAddress(@NotEmpty String lat, @NotEmpty String lng);
|
||||
}
|
||||
@@ -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