BoundHashOperations<String, Object, Object> hashOps = stringRedisTemplate.boundHashOps(cartKey);
boundvalueops对redis的key进行绑定可直接.get(key)获取redis的value。
String hashOps = stringRedisTemplate.opsForValue().get(cartKey);
opsforvalue是的。需要每次调用。
BoundHashOperations<String, Object, Object> hashOps = stringRedisTemplate.boundHashOps(cartKey);
boundvalueops对redis的key进行绑定可直接.get(key)获取redis的value。
String hashOps = stringRedisTemplate.opsForValue().get(cartKey);
opsforvalue是的。需要每次调用。