package com.qmth.teachcloud.common.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.teachcloud.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);

    @Deprecated
    boolean saveRole(SysRole role);

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

    boolean enable(SysRole role) throws NoSuchAlgorithmException;

    boolean remove(Long id);

    List<Long> getUserRoles(Long userId);

    List<SysRole> listRolesByUserId(Long id);

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

    List<SysRole> listToUser();
}
