先贴一下yml
server:
port: 8091
max-http-header-size: 10240
servlet:
context-path: /
spring:
profiles:
active: dev
再贴一下dev-yml
spring:
redis:
host: 127.0.0.1
port: 7379
database: 0
password:
timeout: 100000
lettuce:
pool:
max-active: 100
max-idle: 50
max-wait: 6000
min-idle: 10
引用@value的代码:
import java.lang.reflect.Method;
import java.time.Duration;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Resource;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redi