From 0505d6d20116e41ae8c937b3b3c58219a38f6e80 Mon Sep 17 00:00:00 2001 From: wujiawei <12345678> Date: Sat, 7 Jun 2025 00:27:02 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E6=B7=BB=E5=8A=A0=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServerHandlerInProxyFlowHandler.java | 31 ++++++++---- .../pom.xml | 47 ++++++++++--------- 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/netty/flow/proxy/ServerHandlerInProxyFlowHandler.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/netty/flow/proxy/ServerHandlerInProxyFlowHandler.java index 6c6711a..2918bc6 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/netty/flow/proxy/ServerHandlerInProxyFlowHandler.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/netty/flow/proxy/ServerHandlerInProxyFlowHandler.java @@ -2,22 +2,26 @@ package org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy; import io.netty.channel.Channel; import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy.AbstractHandleChannelProxyFlowAdvanced; -import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.ChannelFlow; import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy.ChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; +import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType; +import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType; import org.framework.lazy.cloud.network.heartbeat.server.properties.ServerNodeProperties; +import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyProxyFlowApplication; import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyVisitorPortFlowApplication; -import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.visitor.flow.LazyVisitorPortFlowStoryCommand; +import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.proxy.flow.LazyProxyFlowStoryCommand; /** * 进口流量处理 */ public class ServerHandlerInProxyFlowHandler extends AbstractHandleChannelProxyFlowAdvanced { private final LazyVisitorPortFlowApplication lazyVisitorPortFlowApplication; + private final LazyProxyFlowApplication lazyProxyFlowApplication; private final ServerNodeProperties serverNodeProperties; - public ServerHandlerInProxyFlowHandler(LazyVisitorPortFlowApplication lazyVisitorPortFlowApplication, ServerNodeProperties serverNodeProperties) { + public ServerHandlerInProxyFlowHandler(LazyVisitorPortFlowApplication lazyVisitorPortFlowApplication, LazyProxyFlowApplication lazyProxyFlowApplication, ServerNodeProperties serverNodeProperties) { this.lazyVisitorPortFlowApplication = lazyVisitorPortFlowApplication; + this.lazyProxyFlowApplication = lazyProxyFlowApplication; this.serverNodeProperties = serverNodeProperties; } @@ -45,15 +49,24 @@ public class ServerHandlerInProxyFlowHandler extends AbstractHandleChannelProxyF @Override protected void doHandler(Channel channel, ChannelProxyFlow channelProxyFlow) { String clientId = channelProxyFlow.clientId(); + String ip = channelProxyFlow.ip(); Integer port = channelProxyFlow.port(); Integer flow = channelProxyFlow.flow(); + ChannelProtocolType channelProtocolType = channelProxyFlow.channelProtocolType(); + ChannelProxyType channelProxyType = channelProxyFlow.channelProxyType(); + // TODO // 进口流量处理 - LazyVisitorPortFlowStoryCommand visitorPortFlow = new LazyVisitorPortFlowStoryCommand(); - visitorPortFlow.setInFlow(flow); - visitorPortFlow.setClientId(clientId); - visitorPortFlow.setVisitorPort(port); - visitorPortFlow.setIsDeleted(false); - lazyVisitorPortFlowApplication.flowIncreaseStory(visitorPortFlow); + LazyProxyFlowStoryCommand lazyProxyFlowStoryCommand = new LazyProxyFlowStoryCommand(); + lazyProxyFlowStoryCommand.setInFlow(flow); + lazyProxyFlowStoryCommand.setClientId(clientId); + lazyProxyFlowStoryCommand.setIp(ip); + lazyProxyFlowStoryCommand.setPort(port); + lazyProxyFlowStoryCommand.setProtocolType(channelProtocolType); + lazyProxyFlowStoryCommand.setProxyType(channelProxyType); + + lazyProxyFlowStoryCommand.setIsDeleted(false); + lazyProxyFlowApplication.flowIncreaseStory(lazyProxyFlowStoryCommand); + } } diff --git a/wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start/pom.xml b/wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start/pom.xml index 2148242..0820ace 100644 --- a/wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start/pom.xml +++ b/wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start/pom.xml @@ -32,29 +32,30 @@ - - org.graalvm.buildtools - native-maven-plugin - 0.10.3 - - - ${project.artifactId} - - org.framework.lazy.cloud.network.heartbeat.server.LazyCloudHeartbeatServerStart - - --no-fallback - - - - - build-native - - compile-no-fork - - package - - - + + org.graalvm.buildtools + native-maven-plugin + 0.10.3 + + + ${project.artifactId} + + org.framework.lazy.cloud.network.heartbeat.server.LazyCloudHeartbeatServerStart + + + --no-fallback + + + + + build-native + + compile-no-fork + + package + + + org.springframework.boot spring-boot-maven-plugin