package com.kmall.manager.manager.pingan.properties;

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 PinganPayPropertiesBuilder {
    private static final Logger logger = LoggerFactory.getLogger(PinganPayPropertiesBuilder.class);

    @Autowired
    @Qualifier("pinganPayProperties")
    private PinganPayProperties pinganPayProperties;

    private static PinganPayProperties pinganPayProp;

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

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

}
