List 集合放到redis中,然后在取出来时变成了LinkedHashMap ,
解决方法:
1 赋值时,将list转为Json
List list = new Arraylist<>();
redisTemplate.opsForValue().set(“exKey”, JSON.toJSON(list ));
2 取值时,先转成JsonString,在转为List
Object temp = redisTemplate.opsForValue().get("exKey");if (temp != null) {result = JSON.parseArray(JSON.toJSONString(temp), T.class);}