redis存取List
方法有很多种,最建议的是将list转成json字符串存,代码如下:
@Autowired
private StringRedisTemplate stringRedisTemplate;
//list加入redis缓存
stringRedisTemplate.opsForValue().set(key, JSON.toJSON(list).toString</
redis存取List
方法有很多种,最建议的是将list转成json字符串存,代码如下:
@Autowired
private StringRedisTemplate stringRedisTemplate;
//list加入redis缓存
stringRedisTemplate.opsForValue().set(key, JSON.toJSON(list).toString</