diff --git a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/cache/DictCache.java b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/cache/DictCache.java index 31539360..b7e9cb09 100644 --- a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/cache/DictCache.java +++ b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/cache/DictCache.java @@ -40,6 +40,8 @@ public class DictCache { private static final String DICT_VALUE = "dict:value:"; private static final String DICT_LIST = "dict:list:"; + private static final Boolean TENANT_MODE = Boolean.FALSE; + private static IDictClient dictClient; private static IDictClient getDictClient() { @@ -59,7 +61,7 @@ public class DictCache { return CacheUtil.get(DICT_CACHE, DICT_ID, id, () -> { R result = getDictClient().getById(id); return result.getData(); - }); + }, TENANT_MODE); } /** @@ -76,7 +78,7 @@ public class DictCache { dict -> dict.getDictValue().equalsIgnoreCase(dictValue) ).map(Dict::getDictKey).findFirst(); return key.orElse(StringPool.EMPTY); - }); + }, TENANT_MODE); } /** @@ -90,7 +92,7 @@ public class DictCache { return CacheUtil.get(DICT_CACHE, DICT_VALUE + code + StringPool.COLON, String.valueOf(dictKey), () -> { R result = getDictClient().getValue(code, String.valueOf(dictKey)); return result.getData(); - }); + }, TENANT_MODE); } /** @@ -104,7 +106,7 @@ public class DictCache { return CacheUtil.get(DICT_CACHE, DICT_VALUE + code + StringPool.COLON, dictKey, () -> { R result = getDictClient().getValue(code, dictKey); return result.getData(); - }); + }, TENANT_MODE); } /** @@ -117,7 +119,7 @@ public class DictCache { return CacheUtil.get(DICT_CACHE, DICT_LIST, code, () -> { R> result = getDictClient().getList(code); return result.getData(); - }); + }, TENANT_MODE); } }