package com.zhiqiyun.open.service;

import com.zhiqiyun.open.mybatis.paginator.domain.PageBounds;
import com.zhiqiyun.open.mybatis.paginator.domain.PageResult;
import com.zhiqiyun.open.models.RoleInfo;

import java.util.List;
import java.util.Map;

/**
 * @author jtoms
 */
public interface RoleInfoService {
    /**
     * 更新角色信息
     *
     * @param roleInfo
     */
    void updateById(RoleInfo roleInfo);

    /**
     * 插入角色信息
     *
     * @param roleInfo
     */
    void insert(RoleInfo roleInfo);

    /**
     * 删除系统角色
     *
     * @param roleIds
     * @throws Exception
     */
    void deleteByIds(List<Long> roleIds) throws Exception;

    /**
     * 查询角色拥有的权限值
     *
     * @param roleId
     * @return
     */
    List<Long> findAuthorities(Long roleId);

    /**
     * 保存角色的权限值
     *
     * @param roleId
     * @param authorities
     */
    void saveAuthorities(Long roleId, Long[] authorities) throws Exception;

    /**
     * 分页查询角色列表
     *
     * @return
     */
    PageResult<RoleInfo> findPage(PageBounds bounds, Map<String, Object> queryWrapper);
}
