package com.tzy.common.config;

import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @author by po'yi
 * @Classname CommonConfig
 * @Description TODO
 * @Date 2021/12/16 14:05
 */
@Configuration
public class CommonConfig {
	public static BaseConfig baseconfig;
	public static final String ENV_PRO = "prod";
	public static final String ENV_TEST = "test";
	public static final String ENV_DEV = "dev";


	@Resource
	public  void setBaseConfig(BaseConfig baseconfig) {
		CommonConfig.baseconfig = baseconfig;
	}

	public static boolean isProdEnv(){
		return ENV_PRO.equals(baseconfig.getEnv());
	}

	public static boolean isDevEnv(){
		return ENV_DEV.equals(baseconfig.getEnv());
	}
}
