package com.unis.crk.basic.service.impl;

import com.unis.crk.basic.entity.FuncInfo;
import com.unis.crk.basic.mapper.FuncInfoMapper;
import com.unis.crk.basic.service.IFuncInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 功能信息表 服务实现类
 * </p>
 *
 * @author ghh
 * @since 2021-09-26
 */
@Service
public class FuncInfoServiceImpl extends ServiceImpl<FuncInfoMapper, FuncInfo> implements IFuncInfoService {
    @Resource
    private  FuncInfoMapper funcInfoMapper;
    @Override
    public List<FuncInfo> getFuncInfoByRoleId(String roleId) {

        return funcInfoMapper.getFuncInfoByRoleId(roleId);
    }

    @Override
    public List<FuncInfo> getAllFuncInfo() {

        return funcInfoMapper.getAllFuncInfo();
    }

    @Override
    public FuncInfo getByFuncId(String id) {
        return funcInfoMapper.getByFuncId(id);
    }

    /**
     * 获取当前用户所有功能权限
     *
     * @param userId
     * @param isApp
     * @return
     */
    @Override
    public List<FuncInfo> getFuncInfoByUserId(String userId, String isApp) {
        return funcInfoMapper.getFuncInfoByUserId(userId,isApp);
    }
}
