List<CategoryDTO> categoryList = null;
String categoryStr = redisService.get(RedisKeyConstant.CMS_CATEGORY);
if (StringUtil.isNotBlank(categoryStr)) {
categoryList = JSON.parseObject(categoryStr, new TypeReference<List<CategoryDTO>>(){});
}for(CategoryDTO category:categoryList){
}
List<CategoryDTO> categoryList = null;
String categoryStr = redisService.get(RedisKeyConstant.CMS_CATEGORY);
if (StringUtil.isNotBlank(categoryStr)) {
categoryList = JSON.parseObject(categoryStr, new ArrayList<CategoryDTO>().getClass());
}
return categoryList;
https://blog.csdn.net/zzzgd_666/article/details/96431040