propertites配置redis
spring.redis.database=1
spring.redis.host=106.14.9.199
spring.redis.port=16379
spring.redis.password=tc123456
spring.redis.pool.max-active=8
spring.redis.pool.max-wait=-1
spring.redis.pool.max-idle=8
spring.redis.pool.min-idle=0
spring.redis.timeout=0
配置文件:
一、
import com.huashui.sys.advice.GlobalControllerAdvice; import groovy.util.logging.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; /** * @Author: * @Date: */ @Configuration @EnableCaching @ConfigurationProperties(prefix="spring.redis") public class JedisConfiguration extends CachingConfigurerSupport { private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); @Value("${s