package com.oauth.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.oauth.system.entity.SysUserRole;
import com.oauth.system.mapper.SysUserRoleMapper;
import com.oauth.system.service.ISysUserRoleService;
import org.springframework.stereotype.Service;

@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements ISysUserRoleService {

    @Override
    public void deleteRoleUserRelation(Long userId) {
        LambdaQueryWrapper<SysUserRole> userRole = new LambdaQueryWrapper<>();
        userRole.eq(SysUserRole::getUserId, userId);
        boolean remove = this.remove(userRole);
//        if (!remove) {
//            throw new StarBosException("权限取消失败");
//        }
    }

}
