package com.lightinit.hsdatashow.impl;

import com.lightinit.hsdatashow.mapper.RoleModuleMapper;
import com.lightinit.hsdatashow.mapper.SentryRoleActionMapper;
import com.lightinit.hsdatashow.entity.PermissionModule;
import com.lightinit.hsdatashow.entity.SentryRoleAction;
import com.lightinit.hsdatashow.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();
    }
}
