分类缓存获取
This commit is contained in:
parent
239b520939
commit
6b5ca5b337
@ -107,10 +107,10 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CategoryVO> categoryTree() {
|
public List<CategoryVO> categoryTree() {
|
||||||
// List<CategoryVO> categoryVOList = (List<CategoryVO>) cache.get(CachePrefix.CATEGORY.getPrefix());
|
List<CategoryVO> categoryVOList = (List<CategoryVO>) cache.get(CachePrefix.CATEGORY.getPrefix());
|
||||||
// if (categoryVOList != null) {
|
if (categoryVOList != null) {
|
||||||
// return categoryVOList;
|
return categoryVOList;
|
||||||
// }
|
}
|
||||||
|
|
||||||
//获取全部分类
|
//获取全部分类
|
||||||
LambdaQueryWrapper<Category> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Category> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
@ -118,7 +118,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||||||
List<Category> list = this.list(queryWrapper);
|
List<Category> list = this.list(queryWrapper);
|
||||||
|
|
||||||
//构造分类树
|
//构造分类树
|
||||||
List<CategoryVO> categoryVOList = new ArrayList<>();
|
categoryVOList = new ArrayList<>();
|
||||||
for (Category category : list) {
|
for (Category category : list) {
|
||||||
if ("0".equals(category.getParentId())) {
|
if ("0".equals(category.getParentId())) {
|
||||||
CategoryVO categoryVO = new CategoryVO(category);
|
CategoryVO categoryVO = new CategoryVO(category);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user