|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.ylx.common.constant.MassageConstants;
|
|
|
import com.ylx.massage.domain.Location;
|
|
|
import com.ylx.massage.domain.TJs;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.geo.*;
|
|
@@ -22,6 +23,7 @@ import java.util.*;
|
|
|
* @date 2024-04-07 15:49
|
|
|
*/
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class LocationUtil {
|
|
|
|
|
|
@Autowired
|
|
@@ -135,7 +137,7 @@ public class LocationUtil {
|
|
|
public double getDistance(String jsKey,String userKey) {
|
|
|
// 获取两个城市之间的距离
|
|
|
Distance distance = redisTemplate.opsForGeo().distance(GEO_KEY, jsKey, userKey, RedisGeoCommands.DistanceUnit.KILOMETERS);
|
|
|
- System.out.println("获取两之间的距离:"+distance.getValue()+" 千米");
|
|
|
+ log.info("获取"+jsKey + "--"+userKey +"两之间的距离:"+distance.getValue()+"千米");
|
|
|
return distance.getValue();
|
|
|
}
|
|
|
|