diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/LazyNettyServerVisitorApplication.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/LazyNettyServerPermeatePortPoolApplication.java similarity index 98% rename from wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/LazyNettyServerVisitorApplication.java rename to wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/LazyNettyServerPermeatePortPoolApplication.java index 993936b7..0f04843a 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/LazyNettyServerVisitorApplication.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/LazyNettyServerPermeatePortPoolApplication.java @@ -17,7 +17,7 @@ import java.util.List; * @see DefaultDDDLazyApplication **/ -public interface LazyNettyServerVisitorApplication { +public interface LazyNettyServerPermeatePortPoolApplication { /** diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingQueryListCommand.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingQueryListCommand.java index 56367584..735b665b 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingQueryListCommand.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingQueryListCommand.java @@ -20,12 +20,11 @@ import java.time.LocalDateTime; @Schema(title = "internal_network_penetration_mapping_query_List_command", description = "内网穿透映射") public class LazyServerPermeateClientMappingQueryListCommand { - /** - * 客户端ID + * 目标客户端ID */ - @Schema(description = "客户端ID", name = "clientId", example = "") - private String clientId; + @Schema(description = "目标客户端ID", name = "targetClientId", example = "") + private String targetClientId; /** * 客户端目标地址 @@ -68,11 +67,19 @@ public class LazyServerPermeateClientMappingQueryListCommand { */ @Schema(description = "描述", name = "describe", example = "") private String describe; + /** - * 命名空间 + * + * 源命名空间 */ - @Schema(description = "命名空间", name = "namespace", example = "") - private String namespace; + @Schema(description = "源命名空间", name = "originNamespace", example = "") + private String originNamespace; + /** + * + * 目标命名空间 + */ + @Schema(description = "目标命名空间", name = "targetNamespace", example = "") + private String targetNamespace; /** * 源 客户端 协议类型 */ diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingQueryOneCommand.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingQueryOneCommand.java index 88158ddc..ca3317f4 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingQueryOneCommand.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingQueryOneCommand.java @@ -22,10 +22,10 @@ public class LazyServerPermeateClientMappingQueryOneCommand { /** - * 客户端ID + * 目标客户端ID */ - @Schema(description = "客户端ID", name = "clientId", example = "") - private String clientId; + @Schema(description = "目标客户端ID", name = "targetClientId", example = "") + private String targetClientId; /** * 客户端目标地址 @@ -67,11 +67,19 @@ public class LazyServerPermeateClientMappingQueryOneCommand { */ @Schema(description = "描述", name = "describe", example = "") private String describe; + /** - * 命名空间 + * + * 源命名空间 */ - @Schema(description = "命名空间", name = "namespace", example = "") - private String namespace; + @Schema(description = "源命名空间", name = "originNamespace", example = "") + private String originNamespace; + /** + * + * 目标命名空间 + */ + @Schema(description = "目标命名空间", name = "targetNamespace", example = "") + private String targetNamespace; /** * 源 客户端 协议类型 */ diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingRemoveCommand.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingRemoveCommand.java index 61c040c7..8ab9f815 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingRemoveCommand.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingRemoveCommand.java @@ -20,13 +20,11 @@ import org.wu.framework.web.response.mark.ValidType; @Schema(title = "internal_network_penetration_mapping_remove_command", description = "内网穿透映射") public class LazyServerPermeateClientMappingRemoveCommand { - /** - * 客户端ID + * 目标客户端ID */ - @NotNull(message = "客户端ID 不能为空", groups = ValidType.Delete.class) - @Schema(description = "客户端ID", name = "clientId", example = "") - private String clientId; + @Schema(description = "目标客户端ID", name = "targetClientId", example = "") + private String targetClientId; /** * 客户端目标地址 @@ -59,11 +57,19 @@ public class LazyServerPermeateClientMappingRemoveCommand { */ @Schema(description = "描述", name = "describe", example = "") private String describe; + /** - * 命名空间 + * + * 源命名空间 */ - @Schema(description = "命名空间", name = "namespace", example = "") - private String namespace; + @Schema(description = "源命名空间", name = "originNamespace", example = "") + private String originNamespace; + /** + * + * 目标命名空间 + */ + @Schema(description = "目标命名空间", name = "targetNamespace", example = "") + private String targetNamespace; /** * 源 客户端 协议类型 */ diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingStoryCommand.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingStoryCommand.java index 9eae65fd..4f7bda00 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingStoryCommand.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingStoryCommand.java @@ -20,10 +20,10 @@ public class LazyServerPermeateClientMappingStoryCommand { /** - * 客户端ID + * 目标客户端ID */ - @Schema(description = "客户端ID", name = "clientId", example = "") - private String clientId; + @Schema(description = "目标客户端ID", name = "targetClientId", example = "") + private String targetClientId; /** * 客户端目标地址 @@ -43,6 +43,18 @@ public class LazyServerPermeateClientMappingStoryCommand { @Schema(description = "主键自增", name = "id", example = "") private Long id; + /** + * + * 源命名空间 + */ + @Schema(description = "源命名空间", name = "originNamespace", example = "") + private String originNamespace; + /** + * + * 目标命名空间 + */ + @Schema(description = "目标命名空间", name = "targetNamespace", example = "") + private String targetNamespace; /** * 访问端口 */ @@ -53,11 +65,7 @@ public class LazyServerPermeateClientMappingStoryCommand { */ @Schema(description = "描述", name = "describe", example = "") private String describe; - /** - * 命名空间 - */ - @Schema(description = "命名空间", name = "namespace", example = "") - private String namespace; + /** * 是否是ssl */ diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingUpdateCommand.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingUpdateCommand.java index 5540f650..01262371 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingUpdateCommand.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/command/lazy/netty/server/permeate/client/mapping/LazyServerPermeateClientMappingUpdateCommand.java @@ -21,12 +21,10 @@ import org.wu.framework.web.response.mark.ValidType; public class LazyServerPermeateClientMappingUpdateCommand { /** - * 客户端ID + * 目标客户端ID */ - @NotNull(message = "客户端ID 不能为空", groups = ValidType.Delete.class) - @Schema(description = "客户端ID", name = "clientId", example = "") - private String clientId; - + @Schema(description = "目标客户端ID", name = "targetClientId", example = "") + private String targetClientId; /** * 客户端目标地址 */ @@ -58,11 +56,19 @@ public class LazyServerPermeateClientMappingUpdateCommand { */ @Schema(description = "描述", name = "describe", example = "") private String describe; + /** - * 命名空间 + * + * 源命名空间 */ - @Schema(description = "命名空间", name = "namespace", example = "") - private String namespace; + @Schema(description = "源命名空间", name = "originNamespace", example = "") + private String originNamespace; + /** + * + * 目标命名空间 + */ + @Schema(description = "目标命名空间", name = "targetNamespace", example = "") + private String targetNamespace; /** * 是否是ssl diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/dto/LazyServerPermeateClientMappingDTO.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/dto/LazyServerPermeateClientMappingDTO.java index e11d8b64..0858b0a7 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/dto/LazyServerPermeateClientMappingDTO.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/dto/LazyServerPermeateClientMappingDTO.java @@ -23,10 +23,10 @@ public class LazyServerPermeateClientMappingDTO { /** - * 客户端ID + * 目标客户端ID */ - @Schema(description = "客户端ID", name = "clientId", example = "") - private String clientId; + @Schema(description = "目标客户端ID", name = "targetClientId", example = "") + private String targetClientId; /** * 客户端目标地址 @@ -76,11 +76,19 @@ public class LazyServerPermeateClientMappingDTO { */ @Schema(description = "描述", name = "describe", example = "") private String describe; + /** - * 命名空间 + * + * 源命名空间 */ - @Schema(description = "命名空间", name = "namespace", example = "") - private String namespace; + @Schema(description = "源命名空间", name = "originNamespace", example = "") + private String originNamespace; + /** + * + * 目标命名空间 + */ + @Schema(description = "目标命名空间", name = "targetNamespace", example = "") + private String targetNamespace; /** * 是否是ssl */ diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyNettyServerVisitorApplicationImpl.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyNettyServerPermeatePortPoolApplicationImpl.java similarity index 97% rename from wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyNettyServerVisitorApplicationImpl.java rename to wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyNettyServerPermeatePortPoolApplicationImpl.java index 06a5aade..851b6ad9 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyNettyServerVisitorApplicationImpl.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyNettyServerPermeatePortPoolApplicationImpl.java @@ -1,7 +1,7 @@ package org.framework.lazy.cloud.network.heartbeat.server.standalone.application.impl; import org.framework.lazy.cloud.network.heartbeat.server.properties.ServerNodeProperties; -import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyNettyServerVisitorApplication; +import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyNettyServerPermeatePortPoolApplication; import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.NettyServerVisitorDTOAssembler; import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.server.permeate.port.pool.*; import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyNettyServerVisitorDTO; @@ -24,7 +24,7 @@ import java.util.stream.Collectors; * @see DefaultDDDLazyApplicationImpl **/ @LazyApplication -public class LazyNettyServerVisitorApplicationImpl implements LazyNettyServerVisitorApplication { +public class LazyNettyServerPermeatePortPoolApplicationImpl implements LazyNettyServerPermeatePortPoolApplication { @Resource LazyNettyServerPermeatePortPoolRepository lazyNettyServerPermeatePortPoolRepository; diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyServerPermeateClientMappingApplicationImpl.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyServerPermeateClientMappingApplicationImpl.java index 2b43256d..b509d0f9 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyServerPermeateClientMappingApplicationImpl.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/application/impl/LazyServerPermeateClientMappingApplicationImpl.java @@ -57,8 +57,6 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe public Result story(LazyServerPermeateClientMappingStoryCommand lazyServerPermeateClientMappingStoryCommand) { LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingStoryCommand); lazyNettyServerPermeateClientMapping.setIsDeleted(false); - String serverId = serverNodeProperties.getNodeId(); - lazyNettyServerPermeateClientMapping.setNamespace(serverId); String clientId = lazyNettyServerPermeateClientMapping.getClientId(); String clientTargetIp = lazyNettyServerPermeateClientMapping.getClientTargetIp(); @@ -67,7 +65,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe // 创建访客通道池 - this.changeSocket(serverId, clientId, clientTargetIp, clientTargetPort, visitorPort); + this.changeSocket(lazyNettyServerPermeateClientMapping.getTargetNamespace(), clientId, clientTargetIp, clientTargetPort, visitorPort); return lazyNettyServerPermeateClientMappingRepository.story(lazyNettyServerPermeateClientMapping); } @@ -88,8 +86,6 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe .stream() .map(lazyInternalNetworkPenetrationMappingStoryCommand -> { LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyInternalNetworkPenetrationMappingStoryCommand); - String serverId = serverNodeProperties.getNodeId(); - lazyNettyServerPermeateClientMapping.setNamespace(serverId); return lazyNettyServerPermeateClientMapping; }) .collect(Collectors.toList()); @@ -101,7 +97,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe String clientTargetIp = lazyNettyServerPermeateClientMapping.getClientTargetIp(); Integer clientTargetPort = lazyNettyServerPermeateClientMapping.getClientTargetPort(); Integer visitorPort = lazyNettyServerPermeateClientMapping.getVisitorPort(); - String namespace = lazyNettyServerPermeateClientMapping.getNamespace(); + String namespace = lazyNettyServerPermeateClientMapping.getTargetNamespace(); this.changeSocket(namespace, clientId, clientTargetIp, clientTargetPort, visitorPort); } return batchStory; @@ -120,8 +116,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe @Override public Result updateOne(LazyServerPermeateClientMappingUpdateCommand lazyServerPermeateClientMappingUpdateCommand) { LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingUpdateCommand); - String serverId = serverNodeProperties.getNodeId(); - lazyNettyServerPermeateClientMapping.setNamespace(serverId); + // 删除绑定数据 Result story = lazyNettyServerPermeateClientMappingRepository.story(lazyNettyServerPermeateClientMapping); String clientId = lazyNettyServerPermeateClientMapping.getClientId(); @@ -129,7 +124,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe Integer clientTargetPort = lazyNettyServerPermeateClientMapping.getClientTargetPort(); Integer visitorPort = lazyNettyServerPermeateClientMapping.getVisitorPort(); - this.changeSocket(serverId, clientId, clientTargetIp, clientTargetPort, visitorPort); + this.changeSocket(lazyNettyServerPermeateClientMapping.getTargetNamespace(), clientId, clientTargetIp, clientTargetPort, visitorPort); return story; } @@ -186,8 +181,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe @Override public Result findOne(LazyServerPermeateClientMappingQueryOneCommand lazyServerPermeateClientMappingQueryOneCommand) { LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryOneCommand); - String serverId = serverNodeProperties.getNodeId(); - lazyNettyServerPermeateClientMapping.setNamespace(serverId); + return lazyNettyServerPermeateClientMappingRepository.findOne(lazyNettyServerPermeateClientMapping).convert(LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping); } @@ -204,8 +198,6 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe public Result> findList(LazyServerPermeateClientMappingQueryListCommand lazyServerPermeateClientMappingQueryListCommand) { LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryListCommand); - String serverId = serverNodeProperties.getNodeId(); - lazyNettyServerPermeateClientMapping.setNamespace(serverId); return lazyNettyServerPermeateClientMappingRepository.findList(lazyNettyServerPermeateClientMapping).convert(internalNetworkPenetrationMappings -> internalNetworkPenetrationMappings.stream().map(LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping).collect(Collectors.toList())); } @@ -221,8 +213,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe @Override public Result> findPage(int size, int current, LazyServerPermeateClientMappingQueryListCommand lazyServerPermeateClientMappingQueryListCommand) { LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryListCommand); - String serverId = serverNodeProperties.getNodeId(); - lazyNettyServerPermeateClientMapping.setNamespace(serverId); + return lazyNettyServerPermeateClientMappingRepository.findPage(size, current, lazyNettyServerPermeateClientMapping).convert(page -> page.convert(LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping)); } @@ -239,13 +230,12 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe @Override public Result remove(LazyServerPermeateClientMappingRemoveCommand lazyServerPermeateClientMappingRemoveCommand) { LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingRemoveCommand); - String serverId = serverNodeProperties.getNodeId(); - lazyNettyServerPermeateClientMapping.setNamespace(serverId); + Result remove = lazyNettyServerPermeateClientMappingRepository.remove(lazyNettyServerPermeateClientMapping); // 删除端口映射 String clientId = lazyServerPermeateClientMappingRemoveCommand.getClientId(); Integer visitorPort = lazyServerPermeateClientMappingRemoveCommand.getVisitorPort(); - this.changeCloseSocket(serverId, clientId, visitorPort); + this.changeCloseSocket(lazyNettyServerPermeateClientMapping.getTargetNamespace(), clientId, visitorPort); return remove; } @@ -267,7 +257,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe Integer visitorPort = networkPenetrationMapping.getVisitorPort(); String clientTargetIp = networkPenetrationMapping.getClientTargetIp(); Integer clientTargetPort = networkPenetrationMapping.getClientTargetPort(); - String namespace = networkPenetrationMapping.getNamespace(); + String namespace = networkPenetrationMapping.getTargetNamespace(); this.createVisitor(namespace, clientId, clientTargetIp, clientTargetPort, visitorPort); } return ResultFactory.successOf(); diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/controller/LazyNettyServerPermeatePortPoolProvider.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/controller/LazyNettyServerPermeatePortPoolProvider.java index 431685c5..89aa900a 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/controller/LazyNettyServerPermeatePortPoolProvider.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/controller/LazyNettyServerPermeatePortPoolProvider.java @@ -11,7 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.springframework.web.bind.annotation.*; import org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController; -import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyNettyServerVisitorApplication; +import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyNettyServerPermeatePortPoolApplication; import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyNettyServerVisitorDTO; import java.util.List; @@ -24,11 +24,11 @@ import java.util.List; * @see DefaultDDDLazyController **/ @Tag(name = "服务端提前开放出来的端口提供者") -@EasyController("/netty/server/visitor") +@EasyController("/lazy/netty/server/permeate/port/pool") public class LazyNettyServerPermeatePortPoolProvider { @Resource - private LazyNettyServerVisitorApplication lazyNettyServerVisitorApplication; + private LazyNettyServerPermeatePortPoolApplication lazyNettyServerPermeatePortPoolApplication; /** * describe 新增服务端提前开放出来的端口 @@ -42,7 +42,7 @@ public class LazyNettyServerPermeatePortPoolProvider { @Operation(summary = "新增服务端提前开放出来的端口") @PostMapping("/story") public Result story(@RequestBody LazyNettyServerPermeatePortPoolStoryCommand lazyNettyServerPermeatePortPoolStoryCommand) { - return lazyNettyServerVisitorApplication.story(lazyNettyServerPermeatePortPoolStoryCommand); + return lazyNettyServerPermeatePortPoolApplication.story(lazyNettyServerPermeatePortPoolStoryCommand); } /** @@ -57,7 +57,7 @@ public class LazyNettyServerPermeatePortPoolProvider { @Operation(summary = "批量新增服务端提前开放出来的端口") @PostMapping("/batchStory") public Result> batchStory(@RequestBody List lazyNettyServerPermeatePortPoolStoryCommandList) { - return lazyNettyServerVisitorApplication.batchStory(lazyNettyServerPermeatePortPoolStoryCommandList); + return lazyNettyServerPermeatePortPoolApplication.batchStory(lazyNettyServerPermeatePortPoolStoryCommandList); } /** @@ -72,7 +72,7 @@ public class LazyNettyServerPermeatePortPoolProvider { @Operation(summary = "更新服务端提前开放出来的端口") @PutMapping("/updateOne") public Result updateOne(@RequestBody LazyNettyServerPermeatePortPoolUpdateCommand lazyNettyServerPermeatePortPoolUpdateCommand) { - return lazyNettyServerVisitorApplication.updateOne(lazyNettyServerPermeatePortPoolUpdateCommand); + return lazyNettyServerPermeatePortPoolApplication.updateOne(lazyNettyServerPermeatePortPoolUpdateCommand); } /** @@ -87,7 +87,7 @@ public class LazyNettyServerPermeatePortPoolProvider { @Operation(summary = "查询单个服务端提前开放出来的端口") @GetMapping("/findOne") public Result findOne(@ModelAttribute LazyNettyServerPermeatePortPoolQueryOneCommand lazyNettyServerPermeatePortPoolQueryOneCommand) { - return lazyNettyServerVisitorApplication.findOne(lazyNettyServerPermeatePortPoolQueryOneCommand); + return lazyNettyServerPermeatePortPoolApplication.findOne(lazyNettyServerPermeatePortPoolQueryOneCommand); } /** @@ -102,7 +102,7 @@ public class LazyNettyServerPermeatePortPoolProvider { @Operation(summary = "查询多个服务端提前开放出来的端口") @GetMapping("/findList") public Result> findList(@ModelAttribute LazyNettyServerPermeatePortPoolQueryListCommand lazyNettyServerPermeatePortPoolQueryListCommand) { - return lazyNettyServerVisitorApplication.findList(lazyNettyServerPermeatePortPoolQueryListCommand); + return lazyNettyServerPermeatePortPoolApplication.findList(lazyNettyServerPermeatePortPoolQueryListCommand); } /** @@ -118,7 +118,7 @@ public class LazyNettyServerPermeatePortPoolProvider { @GetMapping("/findPage") public Result> findPage(@Parameter(description = "分页大小") @RequestParam(defaultValue = "10", value = "size") int size, @Parameter(description = "当前页数") @RequestParam(defaultValue = "1", value = "current") int current, @ModelAttribute LazyNettyServerPermeatePortPoolQueryListCommand lazyNettyServerPermeatePortPoolQueryListCommand) { - return lazyNettyServerVisitorApplication.findPage(size, current, lazyNettyServerPermeatePortPoolQueryListCommand); + return lazyNettyServerPermeatePortPoolApplication.findPage(size, current, lazyNettyServerPermeatePortPoolQueryListCommand); } /** @@ -133,6 +133,6 @@ public class LazyNettyServerPermeatePortPoolProvider { @Operation(summary = "删除服务端提前开放出来的端口") @DeleteMapping("/remove") public Result remove(@ModelAttribute LazyNettyServerPermeatePortPoolRemoveCommand lazyNettyServerPermeatePortPoolRemoveCommand) { - return lazyNettyServerVisitorApplication.remove(lazyNettyServerPermeatePortPoolRemoveCommand); + return lazyNettyServerPermeatePortPoolApplication.remove(lazyNettyServerPermeatePortPoolRemoveCommand); } } \ No newline at end of file diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/domain/model/lazy/netty/server/permeate/client/mapping/LazyNettyServerPermeateClientMapping.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/domain/model/lazy/netty/server/permeate/client/mapping/LazyNettyServerPermeateClientMapping.java index 22378a53..9d94c02a 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/domain/model/lazy/netty/server/permeate/client/mapping/LazyNettyServerPermeateClientMapping.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/domain/model/lazy/netty/server/permeate/client/mapping/LazyNettyServerPermeateClientMapping.java @@ -21,10 +21,10 @@ public class LazyNettyServerPermeateClientMapping { /** - * 客户端ID + * 目标客户端ID */ - @Schema(description = "客户端ID", name = "clientId", example = "") - private String clientId; + @Schema(description = "目标客户端ID", name = "targetClientId", example = "") + private String targetClientId; /** * 客户端目标地址 @@ -73,11 +73,19 @@ public class LazyNettyServerPermeateClientMapping { */ @Schema(description = "描述", name = "describe", example = "") private String describe; + /** - * 命名空间 + * + * 源命名空间 */ - @Schema(description = "命名空间", name = "namespace", example = "") - private String namespace; + @Schema(description = "源命名空间", name = "originNamespace", example = "") + private String originNamespace; + /** + * + * 目标命名空间 + */ + @Schema(description = "目标命名空间", name = "targetNamespace", example = "") + private String targetNamespace; /** * 是否是ssl diff --git a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/infrastructure/entity/LazyNettyServerPermeateClientMappingDO.java b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/infrastructure/entity/LazyNettyServerPermeateClientMappingDO.java index a07dfdb8..791dce69 100644 --- a/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/infrastructure/entity/LazyNettyServerPermeateClientMappingDO.java +++ b/wu-lazy-cloud-heartbeat-server/src/main/java/org/framework/lazy/cloud/network/heartbeat/server/standalone/infrastructure/entity/LazyNettyServerPermeateClientMappingDO.java @@ -16,7 +16,6 @@ import java.time.LocalDateTime; * @author Jia wei Wu * @date 2023/12/29 05:21 下午 * @see DefaultDDDLazyInfrastructureEntity - * @see LazyInternalNetworkPenetrationMappingDO **/ @Data @Accessors(chain = true) @@ -26,11 +25,11 @@ public class LazyNettyServerPermeateClientMappingDO { /** - * 客户端ID + * 目标客户端ID */ - @Schema(description = "客户端ID", name = "clientId", example = "") - @LazyTableField(name = "client_id", comment = "客户端ID", columnType = "varchar(255)") - private String clientId; + @Schema(description = "目标客户端ID", name = "targetClientId", example = "") + @LazyTableField(name = "target_client_id", comment = "目标客户端ID", columnType = "varchar(255)") + private String targetClientId; /** * 客户端目标地址 @@ -49,7 +48,7 @@ public class LazyNettyServerPermeateClientMappingDO { /** * to 客户端 协议类型 */ - @LazyTableField(name="to_protocol_type",comment="to 客户端 协议类型",columnType="varchar(255)",defaultValue = "'TCP'") + @LazyTableField(name = "to_protocol_type", comment = "to 客户端 协议类型", columnType = "varchar(255)", defaultValue = "'TCP'") @Schema(description = "to 客户端协议类型", name = "to_protocol_type", example = "") private ProtocolType toProtocolType; @@ -85,7 +84,7 @@ public class LazyNettyServerPermeateClientMappingDO { /** * 源 客户端 协议类型 */ - @LazyTableField(name="origin_protocol_type",comment="源 客户端 协议类型",columnType="varchar(255)",defaultValue = "'TCP'") + @LazyTableField(name = "origin_protocol_type", comment = "源 客户端 协议类型", columnType = "varchar(255)", defaultValue = "'TCP'") @Schema(description = "源 客户端协议类型", name = "origin_protocol_type", example = "") private ProtocolType originProtocolType; @@ -101,17 +100,26 @@ public class LazyNettyServerPermeateClientMappingDO { @Schema(description = "描述", name = "describe", example = "") @LazyTableField(comment = "描述") private String describe; + + /** - * 命名空间 + * 源命名空间 */ - @Schema(description ="命名空间",name ="namespace",example = "") - @LazyTableFieldUnique(name="namespace",comment="命名空间",columnType="varchar(25)",defaultValue = "DEFAULT") - private String namespace; + @Schema(description = "源命名空间", name = "originNamespace", example = "") + @LazyTableFieldUnique(name = "origin_namespace", comment = "源命名空间", columnType = "varchar(25)") + private String originNamespace; + + /** + * 目标命名空间 + */ + @Schema(description = "目标命名空间", name = "targetNamespace", example = "") + @LazyTableFieldUnique(name = "target_namespace", comment = "目标命名空间", columnType = "varchar(25)") + private String targetNamespace; /** * 是否是ssl */ - @Schema(description ="是否是ssl",name ="is_ssl",example = "") - @LazyTableField(name="is_ssl",comment="是否是ssl",defaultValue = "'0'") + @Schema(description = "是否是ssl", name = "is_ssl", example = "") + @LazyTableField(name = "is_ssl", comment = "是否是ssl", defaultValue = "'0'") private Boolean isSsl; } \ No newline at end of file