feat(event): 新增压降落点区域判定功能
- 在EventAnalysisService中添加determineDropZone方法用于判定压降落点区域 - 实现压降落点区域判定逻辑,支持A/B/C/D四个区域的分类判断 - 添加精确的数值范围匹配算法,使用BigDecimal确保计算精度 - 集成日志记录功能,便于问题排查和监控 - 在RedisUtil中新增scanKeysByPattern方法支持模糊查询key功能 - 优化代码结构,移除冗余的导入包和空行 - 更新类级别的注解配置,添加@Slf4j注解支持日志功能
This commit is contained in:
@@ -347,6 +347,30 @@ public class RedisUtil {
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key模糊查询,并取出所有符合条件的key集合
|
||||
* @return
|
||||
*/
|
||||
|
||||
public Set<String> scanKeysByPattern(String pattern, int count) {
|
||||
Set<String> keys = new HashSet<>();
|
||||
ScanOptions options = ScanOptions.scanOptions()
|
||||
.match(pattern)
|
||||
.count(count)
|
||||
.build();
|
||||
|
||||
try (Cursor<byte[]> cursor = redisTemplate.getConnectionFactory()
|
||||
.getConnection()
|
||||
.scan(options)) {
|
||||
while (cursor.hasNext()) {
|
||||
keys.add(new String(cursor.next()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("扫描Redis keys失败", e);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据切库
|
||||
* @param dbIndex
|
||||
|
||||
Reference in New Issue
Block a user