diff --git a/fizz-bootstrap/pom.xml b/fizz-bootstrap/pom.xml
index b5a0313..9c2eee7 100644
--- a/fizz-bootstrap/pom.xml
+++ b/fizz-bootstrap/pom.xml
@@ -17,9 +17,9 @@
1.8
5.2.13.RELEASE
Dragonfruit-SR3
- Dysprosium-SR23
+ Dysprosium-SR24
5.3.7.RELEASE
- 4.1.68.Final
+ 4.1.69.Final
4.4.14
2.14.1
1.7.32
diff --git a/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java b/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java
index 00d5113..61a89dc 100644
--- a/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java
+++ b/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java
@@ -48,9 +48,9 @@ import java.util.Set;
public class FizzServerWebExchangeDecorator extends ServerWebExchangeDecorator {
- private static final MultiValueMap EMPTY_FORM_DATA = CollectionUtils.unmodifiableMultiValueMap(new LinkedMultiValueMap(0));
+ public static final MultiValueMap EMPTY_FORM_DATA = CollectionUtils.unmodifiableMultiValueMap(new LinkedMultiValueMap(0));
- private static final Mono> EMPTY_FORM_DATA_MONO = Mono.just(EMPTY_FORM_DATA).cache();
+ public static final Mono> EMPTY_FORM_DATA_MONO = Mono.just(EMPTY_FORM_DATA).cache();
public FizzServerWebExchangeDecorator(ServerWebExchange delegate) {
super(delegate);
diff --git a/fizz-core/src/main/java/we/controller/CacheCheckController.java b/fizz-core/src/main/java/we/controller/CacheCheckController.java
index 874c2dd..d5e7ce9 100644
--- a/fizz-core/src/main/java/we/controller/CacheCheckController.java
+++ b/fizz-core/src/main/java/we/controller/CacheCheckController.java
@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
-import we.dict.DictService;
+import we.global_resource.GlobalResourceService;
import we.plugin.auth.ApiConfigService;
import we.plugin.auth.ApiConifg2appsService;
import we.plugin.auth.AppService;
@@ -56,7 +56,7 @@ public class CacheCheckController {
private ApiConifg2appsService apiConifg2appsService;
@Resource
- private DictService dictService;
+ private GlobalResourceService globalResourceService;
@GetMapping("/gatewayGroups")
public Mono gatewayGroups(ServerWebExchange exchange) {
@@ -88,8 +88,8 @@ public class CacheCheckController {
return Mono.just(JacksonUtils.writeValueAsString(apiConifg2appsService.getApiConfig2appsMap()));
}
- @GetMapping("/dicts")
+ @GetMapping("/globalResources")
public Mono dicts(ServerWebExchange exchange) {
- return Mono.just(JacksonUtils.writeValueAsString(dictService.getDictMap()));
+ return Mono.just(JacksonUtils.writeValueAsString(globalResourceService.getResourceMap()));
}
}
diff --git a/fizz-core/src/main/java/we/dict/DictService.java b/fizz-core/src/main/java/we/dict/DictService.java
deleted file mode 100644
index 9e8018e..0000000
--- a/fizz-core/src/main/java/we/dict/DictService.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2020 the original author or authors.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package we.dict;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.data.redis.core.ReactiveStringRedisTemplate;
-import org.springframework.stereotype.Service;
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-import we.FizzAppContext;
-import we.config.AggregateRedisConfig;
-import we.util.JacksonUtils;
-import we.util.ReactiveResult;
-import we.util.Result;
-import we.util.Utils;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author hongqiaowei
- */
-
-@Service
-public class DictService {
-
- private static final Logger log = LoggerFactory.getLogger(DictService.class);
-
- private Map dictMap = new HashMap<>(64);
-
- @Resource(name = AggregateRedisConfig.AGGREGATE_REACTIVE_REDIS_TEMPLATE)
- private ReactiveStringRedisTemplate rt;
-
- @PostConstruct
- public void init() throws Throwable {
- initDict().subscribe(
- r -> {
- if (r.code == ReactiveResult.SUCC) {
- lsnInitChange().subscribe(
- res -> {
- if (res.code == ReactiveResult.FAIL) {
- log.error(res.toString());
- if (res.t == null) {
- throw Utils.runtimeExceptionWithoutStack("lsn dict error");
- }
- throw new RuntimeException(res.t);
- }
- }
- );
- } else {
- log.error(r.toString());
- if (r.t == null) {
- throw Utils.runtimeExceptionWithoutStack("init dict error");
- }
- throw new RuntimeException(r.t);
- }
- }
- );
- }
-
- private Mono> initDict() {
- Flux> dicts = rt.opsForHash().entries("fizz_dict");
- dicts.collectList()
- .defaultIfEmpty(Collections.emptyList())
- .flatMap(
- es -> {
- if (FizzAppContext.appContext != null) {
- for (Map.Entry