package com.kmall.common.utils.pay.data.open.cus;

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 Scott Chen
 * @since 1.0
 * 2018-09-27
 */
@Component
public class CusPropertiesBuilder {
    private static final Logger logger = LoggerFactory.getLogger(CusPropertiesBuilder.class);

    @Autowired
    @Qualifier("cusProperties")
    private CusProperties cusProperties;

    private static CusProperties cusProp;

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

    public static CusProperties instance(){
        logger.info("CusProperties实例返回");
        return cusProp;
    }

}
