package com.ruoyi.cai.manager;

import com.ruoyi.cai.enums.SystemConfigEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Set;

@Component
public class InnerUserFilter {
    @Autowired
    private SystemConfigManager systemConfigManager;

    public boolean checkInner(Long ... userId){
        Set<Long> systemCustomerService = systemConfigManager.getSystemConfigOfLongSet(SystemConfigEnum.SYSTEM_CUSTOMER_SERVICE);
        for (Long u : userId) {
            if(systemCustomerService.contains(u)){
                return true;
            }
        }
        return false;
    }

    public boolean checkInner(List<Long> userId){
        Set<Long> systemCustomerService = systemConfigManager.getSystemConfigOfLongSet(SystemConfigEnum.SYSTEM_CUSTOMER_SERVICE);
        for (Long u : userId) {
            if(systemCustomerService.contains(u)){
                return true;
            }
        }
        return false;
    }
}
