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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.paper.library.common.entity.SysRole;

import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * <p>
 * 角色表 服务类
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface SysRoleService extends IService<SysRole> {

    IPage<SysRole> list(String name, Boolean enable, Integer pageNumber, Integer pageSize);

    /**
     * 新增角色
     *
     * @param role
     * @return
     */
    boolean saveRoleNew(SysRole role);

    boolean saveRoleReportNew(SysRole role);

    boolean enable(SysRole role) throws NoSuchAlgorithmException;

    boolean enableReport(SysRole role) throws NoSuchAlgorithmException;

    boolean remove(Long id);

    boolean removeReport(String id);

    List<Long> getUserRoles(Long userId);

    List<SysRole> listRolesByUserId(Long id);

    List<SysRole> list(Long[] roleIds, String name);

    List<SysRole> listToUser();

    boolean builtin(Long id, boolean defaultRole);
}
