增加sczx_order服务的路由映射,增加请求响应的日志

This commit is contained in:
2025-07-20 00:27:21 +08:00
parent e72fee531c
commit b1ef12c800
2 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package com.sczx.gateway.component;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.gateway.event.RefreshRoutesEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.scheduling.annotation.Scheduled;
@ -14,6 +15,9 @@ public class DynamicRouteScheduler {
@Autowired
private ApplicationEventPublisher publisher;
@Autowired
private DiscoveryClient discoveryClient;
// 每30秒刷新一次路由可按需调整
@Scheduled(fixedRate = 30_000)
public void refreshRoutes() {