package com.kmall.manager.manager.merch;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author huangyaqin
 * @since 1.0
 * 2018-10-24
 */
@Component
public class OmsMerchPropertiesBuilder {
    private static final Logger logger = LoggerFactory.getLogger(OmsMerchPropertiesBuilder.class);

    @Autowired
    @Qualifier("omsMerchProperties")
    private OmsMerchProperties omsMerchProperties;

    private static OmsMerchProperties merchProp;

    /**
     * Bean 向静态变量赋值
     */
    @PostConstruct
    private void init(){
        logger.info("MerchProperties初始化开始......");
        merchProp = omsMerchProperties;
    }

    public static OmsMerchProperties instance(){
        logger.info("MerchProperties实例返回");
        return merchProp;
    }

}
