@Override
public Map<String, List<Catalog2Vo>> getCatalogJson() {
String catalogJSON = stringRedisTemplate.opsForValue().get("catalogJSON");
if (StringUtils.isEmpty(catalogJSON)) {
Map<String, List<Catalog2Vo>> catalogJsonFromDB = getCatalogJsonFromDB();
String s = JSON.toJSONString(catalogJsonFromDB);
stringRedisTemplate.opsForValue().set("catalogJSON", s);
return catalogJsonFromDB;
}
Map<String, List<Catalog2Vo>> result =
JSON.parseObject(catalogJSON, new TypeReference<Map<String, List<Catalog2Vo>>>() {
});
return result;
}