package com.chinacreator.video.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;

/**
 * 读取指定配置文件
 * @author xu.zhou
 * @date 20190717
 */
@Configuration
@PropertySource("classpath:otherConfig.properties")
public class OtherProperties {
	
	//指定获取属性文件中的redis.keyprefix
	@Value("${redis.keyprefix}")
	private String rediskeyprefix;

	public String getRediskeyprefix() {
		return rediskeyprefix;
	}

	//获取所有属性配置，使用env.getProperty("redis.keyprefix");获取指定的属性值
	@Autowired
    private Environment env;

	public Environment getEnv() {
		return env;
	}
}
