@Autowired private RedisTemplate redisTemplate;
HashOperations forHash = redisTemplate.opsForHash(); if (forHash.hasKey(1, 2)) { }
这个返回true
@Autowired private RedisTemplate<String,String> redisTemplate;
HashOperations forHash = redisTemplate.opsForHash(); if (forHash.hasKey(1, 2)) { }
这个false
加泛型String,返回都是string,如果是long类型还会包long不能转string ?/吐血