package com.cusc.nirvana.user.rnr.project.context;

import com.cusc.nirvana.user.rnr.project.handler.VinCardHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author stayAnd
 * @date 2022/4/8
 */
@Component
public class VinCardContext {

	@Resource
	private Map<String,VinCardHandler> map;

	@Value("${vin.card.name:internalVinCardHandler}")
	private String vinCardHandlerName;

	public VinCardHandler getVinCardHandler(){
		VinCardHandler vinCardHandler = map.get(vinCardHandlerName);
		if (null == vinCardHandler) {
			//throw exception
		}
		return vinCardHandler;
	}
}
