package com.kmall.manager.manager.pay.data.open.cus;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author Scott Chen
 * @since 1.0
 * 2018-09-27
 */
@Component
public class CusPropertiesConfiguration {
    private static final String PROD = "prod";
    private static final String DEV = "dev";

    @Value("${pay.wx.env}")
    private String evn = PROD;

    @Autowired
    private CusProdProperties cusProdProperties;

    @Autowired
    private CusDevProperties cusDevProperties;

    @Bean
    public CusProperties cusProperties(){
        if (evn.equalsIgnoreCase(PROD)) {
            return cusProdProperties;
        }else {
            return cusDevProperties;
        }
    }

}
