package com.chaozhanggui.common.system.config;

import com.chaozhanggui.common.system.util.ParametersUtil;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;


import javax.annotation.PostConstruct;

/**
 * 配置参数接收实体类
 * @author lyf
 */
@Configuration
@PropertySource("classpath:application-common.yml")
@Component
public class ParameterConfig {
    /**
     * 阿里自用型应用appid
     */
    @Value("${parameter.ZY_ALI_APP_ID}")
    public String ZY_ALI_APP_ID;
    /**
     * 正式服务器域名
     */
    @Value("${parameter.domain}")
    public String domain;

    /**
     * 支付宝通道ID
     */
    @Value("${parameter.alipayChannel}")
    public String alipayChannel;
    @PostConstruct
    public void init() {
        ParametersUtil.domain = domain;
        ParametersUtil.alipayChannel = alipayChannel;
    }
}
