package com.qiaoba.module.system.service.impl;

import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.qiaoba.api.system.entity.SysRoleDept;
import com.qiaoba.module.system.mapper.SysRoleDeptMapper;
import com.qiaoba.module.system.service.SysRoleDeptService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色菜单关联 服务层实现
 *
 * @author ailanyin
 * @version 1.0
 * @since 2023/5/9 10:08
 */
@Service
@RequiredArgsConstructor
public class SysRoleDeptServiceImpl implements SysRoleDeptService {

    private final SysRoleDeptMapper sysRoleDeptMapper;

    @Override
    public void insertBatch(List<SysRoleDept> list) {
        Db.saveBatch(list);
    }

    @Override
    public void deleteByRoleId(String roleId) {
        sysRoleDeptMapper.deleteByRoleId(roleId);
    }

    @Override
    public void deleteByRoleIds(List<String> ids) {
        sysRoleDeptMapper.deleteByRoleIds(ids);
    }

}
