...
|
...
|
@@ -34,8 +34,8 @@ public class RedisReadMaliciousUtil { |
|
|
* 获取所有恶意ip集合
|
|
|
* @return
|
|
|
*/
|
|
|
public Set<String> getIps() {
|
|
|
Set<String> value = null;
|
|
|
public Set<byte[]> getIps() {
|
|
|
Set<byte[]> value = null;
|
|
|
try{
|
|
|
value = getKeysInRedisApi(redisReaderTemplate, MALICIOUS_IP);
|
|
|
}catch(Exception e){
|
...
|
...
|
@@ -49,7 +49,7 @@ public class RedisReadMaliciousUtil { |
|
|
* @param redisTemplate
|
|
|
* @param key
|
|
|
*/
|
|
|
private Set<String> getKeysInRedisApi(RedisTemplate<String, String> redisTemplate, String pattern){
|
|
|
return redisTemplate.keys(pattern);
|
|
|
private Set<byte[]> getKeysInRedisApi(RedisTemplate<String, String> redisTemplate, String pattern){
|
|
|
return redisTemplate.getConnectionFactory().getConnection().keys(pattern.getBytes());
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|