From 180e4369c8a602b099a1fd0140935faf476e4ae8 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Mon, 1 Aug 2022 21:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.2.4=E3=80=91=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E9=BB=98=E8=AE=A4=E9=9C=80=E8=A6=81=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E4=B8=80=E4=B8=AA=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../memory/starter/GunsMemoryCacheAutoConfiguration.java | 3 +++ kernel-s-dict/dict-business/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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}