| | |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.geo.Point; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | |
| | | public boolean unlock(){ |
| | | return unlock("redis"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加地理空间索引坐标 |
| | | * @param k |
| | | * @param lon |
| | | * @param lat |
| | | * @param object |
| | | */ |
| | | public void addGeo(String k, Double lon, Double lat, String object){ |
| | | Point point = new Point(lon, lat); |
| | | redisTemplate.opsForGeo().add(k, point, object); |
| | | } |
| | | } |