package com.sunyard.ssp.modules.user.serviceimpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sunyard.ssp.modules.user.entity.ScRole;
import com.sunyard.ssp.modules.user.entity.ScUserRole;
import com.sunyard.ssp.modules.user.mapper.ScUserRoleMapper;
import com.sunyard.ssp.modules.user.service.IScUserRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tsz
 * @since 2020-03-11
 */
@Slf4j
@Service
@Transactional
public class ScUserRoleServiceImpl extends ServiceImpl<ScUserRoleMapper, ScUserRole> implements IScUserRoleService {

    @Autowired
    ScUserRoleMapper userRoleMapper;

    @Override
    public List<ScRole> findByUserId(Long userId) {

        return userRoleMapper.findByUserId(userId);
    }

    @Override
    public List<String> findDepIdsByUserId(Long userId) {

        return userRoleMapper.findDepIdsByUserId(userId);
    }
}
