mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-30 00:32:26 +08:00
JeecgBoot2.4.3版本发布——企业级低代码平台
This commit is contained in:
@ -3,6 +3,7 @@ package org.jeecg.config;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.handler.HystrixFallbackHandler;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package org.jeecg.handler;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.boot.starter.redis.listener.JeecgRedisListerer;
|
||||
import org.jeecg.common.base.BaseMap;
|
||||
import org.jeecg.common.modules.redis.listener.JeecgRedisListerer;
|
||||
import org.jeecg.loader.DynamicRouteLoader;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@ -11,7 +11,8 @@ import com.alibaba.nacos.api.exception.NacosException;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.boot.starter.redis.client.JeecgRedisClient;
|
||||
import org.jeecg.common.modules.redis.client.JeecgRedisClient;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.config.GatewayRoutersConfiguration;
|
||||
import org.jeecg.config.RouterDataType;
|
||||
import org.springframework.cloud.gateway.event.RefreshRoutesEvent;
|
||||
@ -53,14 +54,14 @@ public class DynamicRouteLoader implements ApplicationEventPublisherAware {
|
||||
|
||||
private ConfigService configService;
|
||||
|
||||
private JeecgRedisClient redisClient;
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
|
||||
public DynamicRouteLoader(InMemoryRouteDefinitionRepository repository, DynamicRouteService dynamicRouteService, JeecgRedisClient redisClient) {
|
||||
public DynamicRouteLoader(InMemoryRouteDefinitionRepository repository, DynamicRouteService dynamicRouteService, RedisUtil redisUtil) {
|
||||
|
||||
this.repository = repository;
|
||||
this.dynamicRouteService = dynamicRouteService;
|
||||
this.redisClient = redisClient;
|
||||
this.redisUtil = redisUtil;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
@ -132,10 +133,10 @@ public class DynamicRouteLoader implements ApplicationEventPublisherAware {
|
||||
if (configService == null) {
|
||||
log.warn("initConfigService fail");
|
||||
}
|
||||
String configInfo = redisClient.get("gateway_routes");
|
||||
if (StringUtils.isNotBlank(configInfo)) {
|
||||
Object configInfo = redisUtil.get("gateway_routes");
|
||||
if (ObjectUtil.isNotEmpty(configInfo)) {
|
||||
log.info("获取网关当前配置:\r\n{}", configInfo);
|
||||
JSONArray array = JSON.parseArray(configInfo);
|
||||
JSONArray array = JSON.parseArray(configInfo.toString());
|
||||
try {
|
||||
routes = getRoutesByJson(array);
|
||||
} catch (URISyntaxException e) {
|
||||
|
||||
Reference in New Issue
Block a user