package cn.reghao.oss.console.account.db.query;

import cn.reghao.oss.console.account.model.po.Role;
import cn.reghao.oss.console.account.model.po.User;
import cn.reghao.oss.console.account.model.vo.RoleVO;
import cn.reghao.jutil.jdk.db.BaseQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.List;

/**
 * @author reghao
 * @date 2021-07-12 15:32:26
 */
public interface RoleQuery extends BaseQuery<Role> {
    Role findByName(String name);
    Page<RoleVO> getRoleVOByPage(PageRequest pageRequest);
    List<RoleVO> getByMatchName(String name);
    RoleVO getRoleVOById(Integer id);
    /**
     * 获取拥有角色的用户
     *
     * @param
     * @return
     * @date 2021-07-14 下午2:57
     */
    List<User> getUsersByRoleId(Integer id);
    List<User> getUsersByRole(Role role);
}
