package com.qmth.paper.library.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.paper.library.common.bean.dto.PrivilegeDto;
import com.qmth.paper.library.common.entity.SysPrivilege;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 菜单权限表 服务类
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface SysPrivilegeService extends IService<SysPrivilege> {

    /**
     * 获取所有权限
     *
     * @return
     */
    List<PrivilegeDto> listPrivilegeTreeNew();

    Long savePrivilege(SysPrivilege privilege);

    List<String> getRolePrivileges(Long roleId);

    List<PrivilegeDto> listPrivilegeTreeAuth();

    List<SysPrivilege> getClientUrlByUserId(Long userId);

    /**
     * 递归树查询(同级及以上)
     *
     * @param privilegeId
     * @return
     */
    List<SysPrivilege> findByConnectByParentId(Long privilegeId);

    /**
     * 获取菜单树公用
     *
     * @param sysPrivilegeList
     * @return
     */
    Collection<?> getMenuTreeCommon(Collection<?> sysPrivilegeList);

    List<PrivilegeDto> commonCustomList();

    boolean remove(Long id);
}
