1:从redis中根据key值取map集合
@Resource
private RedisTemplate redisTemplate;
Map<String,Object> redisMap= redisTemplate.opsForHash().entries(key);
2:往redis中存map集合
List<Product> productLsit = commodityServiceLmy.findProductList(params);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("total", count);
hashMap.put("rows", productLsit);
//把map集合保存到redis中
redisTemplate.opsForHash().putAll(key,hashMap);