diff --git a/kernel-d-cache/memory-cache-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/cache/memory/starter/GunsMemoryCacheAutoConfiguration.java b/kernel-d-cache/memory-cache-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/cache/memory/starter/GunsMemoryCacheAutoConfiguration.java index 28a584a72..483474009 100644 --- a/kernel-d-cache/memory-cache-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/cache/memory/starter/GunsMemoryCacheAutoConfiguration.java +++ b/kernel-d-cache/memory-cache-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/cache/memory/starter/GunsMemoryCacheAutoConfiguration.java @@ -29,6 +29,7 @@ import cn.hutool.cache.impl.TimedCache; import cn.stylefeng.roses.kernel.cache.api.constants.CacheConstants; import cn.stylefeng.roses.kernel.cache.memory.operator.DefaultMemoryCacheOperator; import cn.stylefeng.roses.kernel.cache.memory.operator.DefaultStringMemoryCacheOperator; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -48,6 +49,7 @@ public class GunsMemoryCacheAutoConfiguration { * @date 2021/1/31 20:39 */ @Bean + @ConditionalOnMissingBean(name = "defaultStringCacheOperator") public DefaultStringMemoryCacheOperator defaultStringCacheOperator() { TimedCache stringTimedCache = CacheUtil.newTimedCache(CacheConstants.DEFAULT_CACHE_TIMEOUT); return new DefaultStringMemoryCacheOperator(stringTimedCache); @@ -60,6 +62,7 @@ public class GunsMemoryCacheAutoConfiguration { * @date 2021/1/31 20:39 */ @Bean + @ConditionalOnMissingBean(name = "defaultMemoryCacheOperator") public DefaultMemoryCacheOperator defaultMemoryCacheOperator() { TimedCache objectTimedCache = CacheUtil.newTimedCache(CacheConstants.DEFAULT_CACHE_TIMEOUT); return new DefaultMemoryCacheOperator(objectTimedCache); diff --git a/kernel-s-dict/dict-business/pom.xml b/kernel-s-dict/dict-business/pom.xml index 1eff5090d..f51fb2501 100644 --- a/kernel-s-dict/dict-business/pom.xml +++ b/kernel-s-dict/dict-business/pom.xml @@ -70,10 +70,10 @@ spring-boot-starter-web - + cn.stylefeng.roses - cache-api + memory-cache-spring-boot-starter ${roses.version}