package com.elab.redis.componts.config;

import com.elab.redis.consts.CacheConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

@Scope(CacheConstants.REFRESH_CONFIG_SCOPE_NAME)
@Service
public class ConfigController {

    @Value("${elab.name}")
    private String name;

    @Autowired
    Environment environment;

    public String config() {
        String re = "====redis.name.@Value==" + name + " @environment===" + environment.getProperty("elab.name");
        return re;
    }
}