From d71e1e1c965653c57c54b9157f0a55822f0e5162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 25 Jan 2022 23:16:35 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8Dredisson=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=85=8D=E7=BD=AE=E8=A6=86=E7=9B=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/{RedisConfig.java => RedisConfiguration.java} | 5 ++++- .../src/main/resources/META-INF/spring.factories | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) rename ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/config/{RedisConfig.java => RedisConfiguration.java} (97%) diff --git a/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/config/RedisConfig.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/config/RedisConfiguration.java similarity index 97% rename from ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/config/RedisConfig.java rename to ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/config/RedisConfiguration.java index 8ab3a247..8cc0cda1 100644 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/config/RedisConfig.java +++ b/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/config/RedisConfiguration.java @@ -10,7 +10,9 @@ import org.redisson.codec.JsonJacksonCodec; import org.redisson.config.Config; import org.redisson.spring.cache.CacheConfig; import org.redisson.spring.cache.RedissonSpringCacheManager; +import org.redisson.spring.starter.RedissonAutoConfiguration; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.data.redis.RedisProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -32,10 +34,11 @@ import java.util.stream.Collectors; * @author Lion Li */ @Slf4j +@AutoConfigureBefore(RedissonAutoConfiguration.class) @EnableConfigurationProperties(RedissonProperties.class) @Configuration @EnableCaching -public class RedisConfig extends CachingConfigurerSupport { +public class RedisConfiguration extends CachingConfigurerSupport { private static final String REDIS_PROTOCOL_PREFIX = "redis://"; private static final String REDISS_PROTOCOL_PREFIX = "rediss://"; diff --git a/ruoyi-common/ruoyi-common-redis/src/main/resources/META-INF/spring.factories b/ruoyi-common/ruoyi-common-redis/src/main/resources/META-INF/spring.factories index 53bea846..a23b8825 100644 --- a/ruoyi-common/ruoyi-common-redis/src/main/resources/META-INF/spring.factories +++ b/ruoyi-common/ruoyi-common-redis/src/main/resources/META-INF/spring.factories @@ -1,4 +1,4 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - com.ruoyi.common.redis.config.RedisConfig - - +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + com.ruoyi.common.redis.config.RedisConfiguration + +