package com.lightinit.hsdataportal.impl;

import com.lightinit.hsdataportal.mapper.RoleModuleMapper;
import com.lightinit.hsdataportal.mapper.SentryRoleActionMapper;
import com.lightinit.hsdataportal.entity.PermissionModule;
import com.lightinit.hsdataportal.entity.SentryRoleAction;
import com.lightinit.hsdataportal.service.IShiroPermissionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Mr.Yao on 2017/11/8.
 */
@Service
public class ShiroPermissionsServiceImpl implements IShiroPermissionsService {
    @Autowired
    private RoleModuleMapper roleModuleMapper;
    @Autowired
    private SentryRoleActionMapper sentryRoleActionMapper;

    @Override
    public List<SentryRoleAction> selectSentryRoleAction(List<String> roles) {
        return sentryRoleActionMapper.selectSentryRoleAction(roles);
    }
    @Override
    public List<SentryRoleAction> selectSentryRoleAction(String code,List<String> roles) {
        return sentryRoleActionMapper.selectSentryRoleAction(roles);
    }
    @Override
    public List<PermissionModule> findAll() {
        return roleModuleMapper.selectByPermissionMenu();
    }
}
