...
|
...
|
@@ -44,6 +44,16 @@ public class RedisReadMaliciousUtil { |
|
|
return value;
|
|
|
}
|
|
|
|
|
|
public Long getTtl(String key){
|
|
|
Long ttl = null;
|
|
|
try{
|
|
|
ttl = getKeysInRedisTTLApi(aws1Template, key);
|
|
|
}catch(Exception e){
|
|
|
logger.error(" - RedisReadUtil - getIpsBL - error", e);
|
|
|
}
|
|
|
return ttl;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据key获取
|
|
|
* @param redisTemplate
|
...
|
...
|
@@ -52,4 +62,8 @@ public class RedisReadMaliciousUtil { |
|
|
private Set<byte[]> getKeysInRedisApi(RedisTemplate<String, String> redisTemplate, String pattern){
|
|
|
return redisTemplate.getConnectionFactory().getConnection().keys(pattern.getBytes());
|
|
|
}
|
|
|
|
|
|
private Long getKeysInRedisTTLApi(RedisTemplate<String, String> redisTemplate, String key){
|
|
|
return redisTemplate.getExpire(key);
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|