package com.mosty.common.core.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.common.core.business.entity.SysUserRole;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mosty.common.core.business.entity.vo.RoleUserPage;
import com.mosty.common.core.business.entity.vo.RoleUserVO;
import com.mosty.common.core.business.entity.vo.SysUserVO;
import com.mosty.common.core.business.entity.vo.UserRoleVO;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author li
* @description 针对表【sys_user_role(用户和角色关联表)】的数据库操作Service
* @createDate 2022-02-12 16:53:24
*/
public interface SysUserRoleService extends IService<SysUserRole> {

    @ApiOperation("查询角色关联的用户信息")
    IPage<SysUserVO> roleUserList(String rootPath, RoleUserPage roleUserPage);

    @ApiOperation("跟根据用户id查询角色列表")
    List<SysUserRole> listByUserId(Long id);

    @ApiOperation("为用户授权角色")
    boolean grantRoleToUser(UserRoleVO userRoleVo);

    @ApiOperation("为角色授予用户")
    boolean grantUserToRole(RoleUserVO roleUserVO);

}
