package com.sysu.admin.support.system.user_role;

import com.sysu.admin.support.base.BaseService;
import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shu hao
 * @description:
 * @date 2022/5/6 15:58
 */
@Service
public class UserRoleService extends BaseService<UserRole, Long> {

    @Autowired
    private UserRoleRepository mUserRoleRepository;

    public UserRole getRoleByUser(Long userId){
        return mUserRoleRepository.getRoleByUser(userId);
    }

    public List<UserRole> getRoleByUsers(Long userId){
        return mUserRoleRepository.getRoleByUsers(userId);
    }

    @Override
    public JpaPlusRepository<UserRole, Long> r() {
        return this.mUserRoleRepository;
    }
}
