package com.kmall.manager.manager.print.ticket;

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 duanqu
 * @since 1.0
 * 2018-11-2
 */
@Component
public class PrintTicketPropertiesBuilder {
    private static final Logger logger = LoggerFactory.getLogger(PrintTicketPropertiesBuilder.class);

    @Autowired
    private PrintTicketProperties printTicketProperties;

    private static PrintTicketProperties ticketProp;

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

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

}
