优化性能

This commit is contained in:
tanghc
2021-03-02 14:28:22 +08:00
parent 5d00092cc5
commit 91f8c82f0e
4 changed files with 14 additions and 3 deletions

View File

@@ -5,6 +5,9 @@ import com.gitee.sop.gatewaycommon.interceptor.RouteInterceptorContext;
import com.gitee.sop.gatewaycommon.param.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import java.net.URI;
/**
* 演示拦截器
@@ -18,7 +21,10 @@ public class MyRouteInterceptor implements RouteInterceptor {
@Override
public void preRoute(RouteInterceptorContext context) {
ApiParam apiParam = context.getApiParam();
log.info("请求接口:{}, request_id:{}, app_id:{}, ip:{}",
ServerWebExchange exchange = (ServerWebExchange) context.getRequestContext();
URI uri = exchange.getRequest().getURI();
log.info("请求URL:{}, 请求接口:{}, request_id:{}, app_id:{}, ip:{}",
uri,
apiParam.fetchNameVersion(),
apiParam.fetchRequestId(),
apiParam.fetchAppKey(),