Search in sources :

Example 1 with ResourceParam

use of com.besscroft.aurora.mall.admin.domain.param.ResourceParam in project aurora-mall by besscroft.

the class ResourceServiceImpl method getAllResourceTree.

@Override
public List<ResourceParam> getAllResourceTree() {
    List<ResourceParam> list = new ArrayList<>();
    List<AuthResourceSort> resourceSorts = authResourceSortMapper.selectList(new QueryWrapper<>());
    resourceSorts.forEach(r -> {
        ResourceParam resourceParam = new ResourceParam();
        QueryWrapper<AuthResource> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("category_id", r.getId());
        List<AuthResource> resources = this.baseMapper.selectList(queryWrapper);
        resourceParam.setName(r.getCategoryName());
        resourceParam.setDisabled(true);
        resourceParam.setChildren(resources);
        list.add(resourceParam);
    });
    return list;
}
Also used : QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) AuthResourceSort(com.besscroft.aurora.mall.common.entity.AuthResourceSort) ResourceParam(com.besscroft.aurora.mall.admin.domain.param.ResourceParam) AuthResource(com.besscroft.aurora.mall.common.entity.AuthResource)

Aggregations

QueryWrapper (com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)1 ResourceParam (com.besscroft.aurora.mall.admin.domain.param.ResourceParam)1 AuthResource (com.besscroft.aurora.mall.common.entity.AuthResource)1 AuthResourceSort (com.besscroft.aurora.mall.common.entity.AuthResourceSort)1