package com.tuoheng.admin.service.system.role;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.tuoheng.admin.entity.domain.RoleMenu;
import com.tuoheng.admin.mapper.RoleMenuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author ChengWang
 * @Date 2022/12/16
 */
@Service
public class RoleMenuServiceImpl implements IRoleMenuService{

    @Autowired
    private RoleMenuMapper roleMenuMapper;

    @Override
    public boolean deleteRoleMenus(Integer roleId) {
        QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
        //queryWrapper.eq("tenant_id", ShiroUtils.getTenantId());
        queryWrapper.eq("role_id", roleId);
        boolean result = SqlHelper.retBool(roleMenuMapper.delete(queryWrapper));
        return result;
    }
}
