package com.liquidnet.service.dragon.channel.strategy;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author AnJiabin <anjiabin@zhengzai.tv>
 * @version V1.0
 * @Description: TODO
 * @class: Test
 * @Package com.liquidnet.service.dragon.channel.strategy
 * @Copyright: LightNet @ Copyright (c) 2021
 * @date 2021/7/10 14:27
 */
@Component
public class PayChannelStrategyContext {
    private final Map<String, IPayChannelStrategy> handlerMap = new HashMap<>();

    public IPayChannelStrategy getStrategy(String type) {
        return handlerMap.get(type);
    }

    public void putStrategy(String code, IPayChannelStrategy strategy) {
        handlerMap.put(code, strategy);
    }
}
