package cn.freemud.utils;

import cn.freemud.enums.ShoppingCartPromotionEnum;
import cn.freemud.service.IPromotionService;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

/**
 * All rights Reserved, Designed By www.freemud.cn
 *
 * @version V1.0
 * @Title: PromotionFactory
 * @Package cn.freemud.utils
 * @Description:
 * @author: jiaxin.liu
 * @date: 2019/4/18 10:24
 * @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
 * 注意：本内容仅限于上海非码科技内部传阅，禁止外泄以及用于其他的商业目
 */
@Component
@DependsOn("springBeanUtil")
public class PromotionFactory {
    public static IPromotionService getPromotionService(ShoppingCartPromotionEnum shoppingCartPromotionEnum){
        return (IPromotionService) ApplicationContextWareBean.getBean(shoppingCartPromotionEnum.getMsgType());
    }
}
