package com.brilliance.isc.common.register.cci;

import com.brilliance.isc.common.exception.CommonServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class CliBanInfoFactory {

    @Autowired(required = false)
    private Map<String, CliBanInfo> maps;

    public CliBanInfo getCliBanInfo(String type) {
        CliBanInfo cliBanInfo = maps.get(type + ".cciRegister");
        if (cliBanInfo == null) {
            throw new CommonServiceException("CliBanInfo Type " + type + " unknown");
        }
        return cliBanInfo;
    }
}
