|
|
@ -5,6 +5,9 @@ import com.gitee.sop.gatewaycommon.interceptor.RouteInterceptorContext; |
|
|
|
import com.gitee.sop.gatewaycommon.param.ApiParam; |
|
|
|
import com.gitee.sop.gatewaycommon.param.ApiParam; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
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 |
|
|
|
@Override |
|
|
|
public void preRoute(RouteInterceptorContext context) { |
|
|
|
public void preRoute(RouteInterceptorContext context) { |
|
|
|
ApiParam apiParam = context.getApiParam(); |
|
|
|
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.fetchNameVersion(), |
|
|
|
apiParam.fetchRequestId(), |
|
|
|
apiParam.fetchRequestId(), |
|
|
|
apiParam.fetchAppKey(), |
|
|
|
apiParam.fetchAppKey(), |
|
|
|