This commit is contained in:
ls
2024-09-09 17:23:12 +08:00
parent ff601b0755
commit 492d2271f8
234 changed files with 1243 additions and 388042 deletions

View File

@@ -1,13 +1,11 @@
package org.jeecg.config.init;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.CacheConstant;
import org.jeecg.config.JeecgCloudCondition;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.system.service.ISysGatewayRouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Conditional;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
@@ -17,9 +15,11 @@ import org.springframework.stereotype.Component;
*/
@Slf4j
@Component
@Conditional(JeecgCloudCondition.class)
public class SystemInitListener implements ApplicationListener<ApplicationReadyEvent>, Ordered {
@Autowired
RedisUtil redisUtil;
@Autowired
private ISysGatewayRouteService sysGatewayRouteService;
@@ -28,11 +28,7 @@ public class SystemInitListener implements ApplicationListener<ApplicationReadyE
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
log.info(" 服务已启动,初始化路由配置 ###################");
String context = "AnnotationConfigServletWebServerApplicationContext";
if (applicationReadyEvent.getApplicationContext().getDisplayName().indexOf(context) > -1) {
sysGatewayRouteService.addRoute2Redis(CacheConstant.GATEWAY_ROUTES);
}
redisUtil.del("crawler-radhome", "crawler-esarad");
}
@Override