[fix] 优化tcp、udp架构 test

This commit is contained in:
wujiawei 2024-12-17 15:14:09 +08:00
parent f9188037a0
commit fac28c4fc8
11 changed files with 70 additions and 64 deletions

View File

@ -2,6 +2,7 @@ package org.framework.lazy.cloud.network.heartbeat.client.netty.udp.filter;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioDatagramChannel;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.handler.timeout.IdleStateHandler;
@ -12,7 +13,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.decoder.NettyProxyMsgDe
import org.framework.lazy.cloud.network.heartbeat.common.encoder.NettyProxyMsgEncoder;
import org.framework.lazy.cloud.network.heartbeat.common.filter.DebugChannelInitializer;
public class NettyUdpClientFilter extends DebugChannelInitializer<SocketChannel> {
public class NettyUdpClientFilter extends DebugChannelInitializer<NioDatagramChannel> {
private final ChannelTypeAdapter channelTypeAdapter;
@ -24,7 +25,7 @@ public class NettyUdpClientFilter extends DebugChannelInitializer<SocketChannel>
}
@Override
protected void initChannel0(SocketChannel ch) throws Exception {
protected void initChannel0(NioDatagramChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
/* * 解码和编码,应和服务端一致 * */

View File

@ -2,10 +2,13 @@ package org.framework.lazy.cloud.network.heartbeat.client.netty.udp.socket;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.Unpooled;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.DatagramPacket;
import io.netty.channel.socket.nio.NioDatagramChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.util.internal.SocketUtils;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.client.netty.NettyClientSocket;
@ -86,6 +89,7 @@ public class NettyUdpClientSocket implements NettyClientSocket {
.option(ChannelOption.SO_SNDBUF, 1024 * 1024)
.option(ChannelOption.SO_KEEPALIVE, true)
.option(ChannelOption.SO_BROADCAST, true)
// .childOption(ChannelOption.UDP_NODELAY, false)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 1000 * 60)//连接超时时间设置为 60
// .childOption(ChannelOption.RCVBUF_ALLOCATOR, new NettyRecvByteBufAllocator(1024 * 1024))//用于Channel分配接受Buffer的分配器 默认AdaptiveRecvByteBufAllocator.DEFAULT
@ -100,7 +104,7 @@ public class NettyUdpClientSocket implements NettyClientSocket {
future.addListener((ChannelFutureListener) futureListener -> {
if (futureListener.isSuccess()) {
log.info("clientId:{},connect to server IP:{},server port :{} isSuccess ", clientId, inetHost, inetPort);
log.info("clientId:{},connect to server IP:{},server port :{} udp isSuccess ", clientId, inetHost, inetPort);
// 告诉服务端这条连接是client的连接
NettyProxyMsg nettyMsg = new NettyProxyMsg();
nettyMsg.setType(UdpMessageType.UDP_REPORT_CLIENT_CONNECT_SUCCESS);

View File

@ -14,7 +14,7 @@ import org.mapstruct.Mapper;
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
**/
@Mapper
public interface LazyInternalNetworkClientPermeateClientMappingDTOAssembler {
public interface LazyNettyClientPermeateClientMappingDTOAssembler {
/**
@ -26,7 +26,7 @@ public interface LazyInternalNetworkClientPermeateClientMappingDTOAssembler {
* @author Jia wei Wu
* @date 2024/09/17 09:55 晚上
**/
LazyInternalNetworkClientPermeateClientMappingDTOAssembler INSTANCE = Mappers.getMapper(LazyInternalNetworkClientPermeateClientMappingDTOAssembler.class);
LazyNettyClientPermeateClientMappingDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyClientPermeateClientMappingDTOAssembler.class);
/**
* describe 应用层存储入参转换成 领域对象
*

View File

@ -14,7 +14,7 @@ import org.mapstruct.Mapper;
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
**/
@Mapper
public interface LazyInternalNetworkClientPermeateServerMappingDTOAssembler {
public interface LazyNettyClientPermeateServerMappingDTOAssembler {
/**
@ -26,7 +26,7 @@ public interface LazyInternalNetworkClientPermeateServerMappingDTOAssembler {
* @author Jia wei Wu
* @date 2024/09/17 09:26 晚上
**/
LazyInternalNetworkClientPermeateServerMappingDTOAssembler INSTANCE = Mappers.getMapper(LazyInternalNetworkClientPermeateServerMappingDTOAssembler.class);
LazyNettyClientPermeateServerMappingDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyClientPermeateServerMappingDTOAssembler.class);
/**
* describe 应用层存储入参转换成 领域对象
*

View File

@ -15,7 +15,7 @@ import org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLaz
* @see DefaultDDDLazyAssembler
**/
@Mapper
public interface InternalNetworkPenetrationMappingDTOAssembler {
public interface LazyNettyServerPermeateClientMappingDTOAssembler {
/**
@ -24,7 +24,7 @@ public interface InternalNetworkPenetrationMappingDTOAssembler {
* @author Jia wei Wu
* @date 2023/12/29 05:21 下午
**/
InternalNetworkPenetrationMappingDTOAssembler INSTANCE = Mappers.getMapper(InternalNetworkPenetrationMappingDTOAssembler.class);
LazyNettyServerPermeateClientMappingDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyServerPermeateClientMappingDTOAssembler.class);
/**
* describe 应用层存储入参转换成 领域对象

View File

@ -13,7 +13,7 @@ import org.mapstruct.Mapper;
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
**/
@Mapper
public interface LazyInternalNetworkServerPermeateServerMappingDTOAssembler {
public interface LazyNettyServerPermeateServerMappingDTOAssembler {
/**
@ -25,7 +25,7 @@ public interface LazyInternalNetworkServerPermeateServerMappingDTOAssembler {
* @author Jia wei Wu
* @date 2024/09/17 01:35 下午
**/
LazyInternalNetworkServerPermeateServerMappingDTOAssembler INSTANCE = Mappers.getMapper(LazyInternalNetworkServerPermeateServerMappingDTOAssembler.class);
LazyNettyServerPermeateServerMappingDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyServerPermeateServerMappingDTOAssembler.class);
/**
* describe 应用层存储入参转换成 领域对象
*

View File

@ -6,7 +6,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.ChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyClientPermeateClientMappingApplication;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.LazyInternalNetworkClientPermeateClientMappingDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.LazyNettyClientPermeateClientMappingDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.client.permeate.client.mapping.*;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyClientPermeateClientMappingDTO;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.client.permeate.client.mapping.LazyNettyClientPermeateClientMapping;
@ -42,7 +42,7 @@ public class LazyClientPermeateClientMappingApplicationImpl implements LazyClien
@Override
public Result<LazyNettyClientPermeateClientMapping> story(LazyClientPermeateClientMappingStoryCommand lazyClientPermeateClientMappingStoryCommand) {
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingStoryCommand);
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingStoryCommand);
// 下发客户端渗透客户端请求
createClientPermeateClientSocketMessage(lazyNettyClientPermeateClientMapping);
@ -60,7 +60,7 @@ public class LazyClientPermeateClientMappingApplicationImpl implements LazyClien
@Override
public Result<List<LazyNettyClientPermeateClientMapping>> batchStory(List<LazyClientPermeateClientMappingStoryCommand> lazyClientPermeateClientMappingStoryCommandList) {
List<LazyNettyClientPermeateClientMapping> lazyNettyClientPermeateClientMappingList = lazyClientPermeateClientMappingStoryCommandList.stream().map( LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE::toLazyInternalNetworkClientPermeateClientMapping).collect(Collectors.toList());
List<LazyNettyClientPermeateClientMapping> lazyNettyClientPermeateClientMappingList = lazyClientPermeateClientMappingStoryCommandList.stream().map( LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE::toLazyInternalNetworkClientPermeateClientMapping).collect(Collectors.toList());
for (LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping : lazyNettyClientPermeateClientMappingList) {
createClientPermeateClientSocketMessage(lazyNettyClientPermeateClientMapping);
}
@ -78,7 +78,7 @@ public class LazyClientPermeateClientMappingApplicationImpl implements LazyClien
@Override
public Result<LazyNettyClientPermeateClientMapping> updateOne(LazyClientPermeateClientMappingUpdateCommand lazyClientPermeateClientMappingUpdateCommand) {
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingUpdateCommand);
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingUpdateCommand);
createClientPermeateClientSocketMessage(lazyNettyClientPermeateClientMapping);
createClientPermeateClientSocketMessage(lazyNettyClientPermeateClientMapping);
return lazyNettyClientPermeateClientMappingRepository.story(lazyNettyClientPermeateClientMapping);
@ -96,8 +96,8 @@ public class LazyClientPermeateClientMappingApplicationImpl implements LazyClien
@Override
public Result<LazyClientPermeateClientMappingDTO> findOne(LazyClientPermeateClientMappingQueryOneCommand lazyClientPermeateClientMappingQueryOneCommand) {
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingQueryOneCommand);
return lazyNettyClientPermeateClientMappingRepository.findOne(lazyNettyClientPermeateClientMapping).convert(LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateClientMapping);
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingQueryOneCommand);
return lazyNettyClientPermeateClientMappingRepository.findOne(lazyNettyClientPermeateClientMapping).convert(LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateClientMapping);
}
/**
@ -112,8 +112,8 @@ public class LazyClientPermeateClientMappingApplicationImpl implements LazyClien
@Override
public Result<List<LazyClientPermeateClientMappingDTO>> findList(LazyClientPermeateClientMappingQueryListCommand lazyClientPermeateClientMappingQueryListCommand) {
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingQueryListCommand);
return lazyNettyClientPermeateClientMappingRepository.findList(lazyNettyClientPermeateClientMapping) .convert(lazyInternalNetworkClientPermeateClientMappings -> lazyInternalNetworkClientPermeateClientMappings.stream().map(LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateClientMapping).collect(Collectors.toList())) ;
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingQueryListCommand);
return lazyNettyClientPermeateClientMappingRepository.findList(lazyNettyClientPermeateClientMapping) .convert(lazyInternalNetworkClientPermeateClientMappings -> lazyInternalNetworkClientPermeateClientMappings.stream().map(LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateClientMapping).collect(Collectors.toList())) ;
}
/**
@ -128,8 +128,8 @@ public class LazyClientPermeateClientMappingApplicationImpl implements LazyClien
@Override
public Result<LazyPage<LazyClientPermeateClientMappingDTO>> findPage(int size, int current, LazyClientPermeateClientMappingQueryListCommand lazyClientPermeateClientMappingQueryListCommand) {
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingQueryListCommand);
return lazyNettyClientPermeateClientMappingRepository.findPage(size,current, lazyNettyClientPermeateClientMapping) .convert(page -> page.convert(LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateClientMapping)) ;
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingQueryListCommand);
return lazyNettyClientPermeateClientMappingRepository.findPage(size,current, lazyNettyClientPermeateClientMapping) .convert(page -> page.convert(LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateClientMapping)) ;
}
/**
@ -144,7 +144,7 @@ public class LazyClientPermeateClientMappingApplicationImpl implements LazyClien
@Override
public Result<LazyNettyClientPermeateClientMapping> remove(LazyClientPermeateClientMappingRemoveCommand lazyClientPermeateClientMappingRemoveCommand) {
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyInternalNetworkClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingRemoveCommand);
LazyNettyClientPermeateClientMapping lazyNettyClientPermeateClientMapping = LazyNettyClientPermeateClientMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateClientMapping(lazyClientPermeateClientMappingRemoveCommand);
return lazyNettyClientPermeateClientMappingRepository.remove(lazyNettyClientPermeateClientMapping);
}

View File

@ -5,6 +5,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.ChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.server.properties.ServerNodeProperties;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.LazyNettyClientPermeateServerMappingDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.client.permeate.server.mapping.*;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyClientPermeateServerMappingDTO;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.client.permeate.server.mapping.LazyNettyClientPermeateServerMapping;
@ -12,7 +13,6 @@ import org.wu.framework.database.lazy.web.plus.stereotype.LazyApplication;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyClientPermeateServerMappingApplication;
import org.wu.framework.web.response.Result;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.client.permeate.server.mapping.LazyClientPermeateServerMappingQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.LazyInternalNetworkClientPermeateServerMappingDTOAssembler;
import java.util.stream.Collectors;
import jakarta.annotation.Resource;
@ -47,7 +47,7 @@ public class LazyClientPermeateServerMappingApplicationImpl implements LazyClien
@Override
public Result<LazyNettyClientPermeateServerMapping> story(LazyClientPermeateServerMappingStoryCommand lazyClientPermeateServerMappingStoryCommand) {
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingStoryCommand);
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingStoryCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyClientPermeateServerMapping.setServerId(serverId);
// 发送客户端初始化渗透
@ -66,7 +66,7 @@ public class LazyClientPermeateServerMappingApplicationImpl implements LazyClien
@Override
public Result<List<LazyNettyClientPermeateServerMapping>> batchStory(List<LazyClientPermeateServerMappingStoryCommand> lazyClientPermeateServerMappingStoryCommandList) {
List<LazyNettyClientPermeateServerMapping> lazyNettyClientPermeateServerMappingList = lazyClientPermeateServerMappingStoryCommandList.stream().map( LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE::toLazyInternalNetworkClientPermeateServerMapping).collect(Collectors.toList());
List<LazyNettyClientPermeateServerMapping> lazyNettyClientPermeateServerMappingList = lazyClientPermeateServerMappingStoryCommandList.stream().map( LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE::toLazyInternalNetworkClientPermeateServerMapping).collect(Collectors.toList());
for (LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping : lazyNettyClientPermeateServerMappingList) {
String serverId = serverNodeProperties.getNodeId();
lazyNettyClientPermeateServerMapping.setServerId(serverId);
@ -86,7 +86,7 @@ public class LazyClientPermeateServerMappingApplicationImpl implements LazyClien
@Override
public Result<LazyNettyClientPermeateServerMapping> updateOne(LazyClientPermeateServerMappingUpdateCommand lazyClientPermeateServerMappingUpdateCommand) {
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingUpdateCommand);
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingUpdateCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyClientPermeateServerMapping.setServerId(serverId);
// 关闭
@ -111,8 +111,8 @@ public class LazyClientPermeateServerMappingApplicationImpl implements LazyClien
@Override
public Result<LazyClientPermeateServerMappingDTO> findOne(LazyClientPermeateServerMappingQueryOneCommand lazyClientPermeateServerMappingQueryOneCommand) {
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingQueryOneCommand);
return lazyNettyClientPermeateServerMappingRepository.findOne(lazyNettyClientPermeateServerMapping).convert(LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateServerMapping);
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingQueryOneCommand);
return lazyNettyClientPermeateServerMappingRepository.findOne(lazyNettyClientPermeateServerMapping).convert(LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateServerMapping);
}
/**
@ -127,8 +127,8 @@ public class LazyClientPermeateServerMappingApplicationImpl implements LazyClien
@Override
public Result<List<LazyClientPermeateServerMappingDTO>> findList(LazyClientPermeateServerMappingQueryListCommand lazyClientPermeateServerMappingQueryListCommand) {
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingQueryListCommand);
return lazyNettyClientPermeateServerMappingRepository.findList(lazyNettyClientPermeateServerMapping) .convert(lazyInternalNetworkClientPermeateServerMappings -> lazyInternalNetworkClientPermeateServerMappings.stream().map(LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateServerMapping).collect(Collectors.toList())) ;
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingQueryListCommand);
return lazyNettyClientPermeateServerMappingRepository.findList(lazyNettyClientPermeateServerMapping) .convert(lazyInternalNetworkClientPermeateServerMappings -> lazyInternalNetworkClientPermeateServerMappings.stream().map(LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateServerMapping).collect(Collectors.toList())) ;
}
/**
@ -143,8 +143,8 @@ public class LazyClientPermeateServerMappingApplicationImpl implements LazyClien
@Override
public Result<LazyPage<LazyClientPermeateServerMappingDTO>> findPage(int size, int current, LazyClientPermeateServerMappingQueryListCommand lazyClientPermeateServerMappingQueryListCommand) {
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingQueryListCommand);
return lazyNettyClientPermeateServerMappingRepository.findPage(size,current, lazyNettyClientPermeateServerMapping) .convert(page -> page.convert(LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateServerMapping)) ;
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingQueryListCommand);
return lazyNettyClientPermeateServerMappingRepository.findPage(size,current, lazyNettyClientPermeateServerMapping) .convert(page -> page.convert(LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkClientPermeateServerMapping)) ;
}
/**
@ -159,7 +159,7 @@ public class LazyClientPermeateServerMappingApplicationImpl implements LazyClien
@Override
public Result<LazyNettyClientPermeateServerMapping> remove(LazyClientPermeateServerMappingRemoveCommand lazyClientPermeateServerMappingRemoveCommand) {
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyInternalNetworkClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingRemoveCommand);
LazyNettyClientPermeateServerMapping lazyNettyClientPermeateServerMapping = LazyNettyClientPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkClientPermeateServerMapping(lazyClientPermeateServerMappingRemoveCommand);
return lazyNettyClientPermeateServerMappingRepository.remove(lazyNettyClientPermeateServerMapping);
}

View File

@ -7,7 +7,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelFlowAdap
import org.framework.lazy.cloud.network.heartbeat.server.netty.tcp.socket.NettyTcpServerPermeateClientVisitorSocket;
import org.framework.lazy.cloud.network.heartbeat.server.properties.ServerNodeProperties;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyServerPermeateClientMappingApplication;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.InternalNetworkPenetrationMappingDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.LazyNettyServerPermeateClientMappingDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.server.permeate.client.mapping.*;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyServerPermeateClientMappingDTO;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.server.permeate.client.mapping.LazyNettyServerPermeateClientMapping;
@ -55,7 +55,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe
@Override
public Result<LazyNettyServerPermeateClientMapping> story(LazyServerPermeateClientMappingStoryCommand lazyServerPermeateClientMappingStoryCommand) {
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = InternalNetworkPenetrationMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingStoryCommand);
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingStoryCommand);
lazyNettyServerPermeateClientMapping.setIsDeleted(false);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateClientMapping.setServerId(serverId);
@ -87,7 +87,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe
lazyServerPermeateClientMappingStoryCommandList
.stream()
.map(lazyInternalNetworkPenetrationMappingStoryCommand -> {
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = InternalNetworkPenetrationMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyInternalNetworkPenetrationMappingStoryCommand);
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyInternalNetworkPenetrationMappingStoryCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateClientMapping.setServerId(serverId);
return lazyNettyServerPermeateClientMapping;
@ -118,7 +118,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe
@Transactional
@Override
public Result<LazyNettyServerPermeateClientMapping> updateOne(LazyServerPermeateClientMappingUpdateCommand lazyServerPermeateClientMappingUpdateCommand) {
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = InternalNetworkPenetrationMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingUpdateCommand);
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingUpdateCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateClientMapping.setServerId(serverId);
// 删除绑定数据
@ -181,10 +181,10 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe
**/
@Override
public Result<LazyServerPermeateClientMappingDTO> findOne(LazyServerPermeateClientMappingQueryOneCommand lazyServerPermeateClientMappingQueryOneCommand) {
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = InternalNetworkPenetrationMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryOneCommand);
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryOneCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateClientMapping.setServerId(serverId);
return lazyNettyServerPermeateClientMappingRepository.findOne(lazyNettyServerPermeateClientMapping).convert(InternalNetworkPenetrationMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping);
return lazyNettyServerPermeateClientMappingRepository.findOne(lazyNettyServerPermeateClientMapping).convert(LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping);
}
/**
@ -198,11 +198,11 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe
@Override
public Result<List<LazyServerPermeateClientMappingDTO>> findList(LazyServerPermeateClientMappingQueryListCommand lazyServerPermeateClientMappingQueryListCommand) {
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = InternalNetworkPenetrationMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryListCommand);
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryListCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateClientMapping.setServerId(serverId);
return lazyNettyServerPermeateClientMappingRepository.findList(lazyNettyServerPermeateClientMapping).convert(internalNetworkPenetrationMappings -> internalNetworkPenetrationMappings.stream().map(InternalNetworkPenetrationMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping).collect(Collectors.toList()));
return lazyNettyServerPermeateClientMappingRepository.findList(lazyNettyServerPermeateClientMapping).convert(internalNetworkPenetrationMappings -> internalNetworkPenetrationMappings.stream().map(LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping).collect(Collectors.toList()));
}
/**
@ -216,10 +216,10 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe
@Override
public Result<LazyPage<LazyServerPermeateClientMappingDTO>> findPage(int size, int current, LazyServerPermeateClientMappingQueryListCommand lazyServerPermeateClientMappingQueryListCommand) {
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = InternalNetworkPenetrationMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryListCommand);
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingQueryListCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateClientMapping.setServerId(serverId);
return lazyNettyServerPermeateClientMappingRepository.findPage(size, current, lazyNettyServerPermeateClientMapping).convert(page -> page.convert(InternalNetworkPenetrationMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping));
return lazyNettyServerPermeateClientMappingRepository.findPage(size, current, lazyNettyServerPermeateClientMapping).convert(page -> page.convert(LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE::fromInternalNetworkPenetrationMapping));
}
/**
@ -234,7 +234,7 @@ public class LazyServerPermeateClientMappingApplicationImpl implements LazyServe
@Transactional
@Override
public Result<LazyNettyServerPermeateClientMapping> remove(LazyServerPermeateClientMappingRemoveCommand lazyServerPermeateClientMappingRemoveCommand) {
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = InternalNetworkPenetrationMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingRemoveCommand);
LazyNettyServerPermeateClientMapping lazyNettyServerPermeateClientMapping = LazyNettyServerPermeateClientMappingDTOAssembler.INSTANCE.toInternalNetworkPenetrationMapping(lazyServerPermeateClientMappingRemoveCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateClientMapping.setServerId(serverId);
Result<LazyNettyServerPermeateClientMapping> remove = lazyNettyServerPermeateClientMappingRepository.remove(lazyNettyServerPermeateClientMapping);

View File

@ -7,7 +7,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelFlowAdap
import org.framework.lazy.cloud.network.heartbeat.server.netty.tcp.socket.NettyTcpServerPermeateServerConnectVisitorSocket;
import org.framework.lazy.cloud.network.heartbeat.server.properties.ServerNodeProperties;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyServerPermeateServerMappingApplication;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.LazyInternalNetworkServerPermeateServerMappingDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.LazyNettyServerPermeateServerMappingDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.server.permeate.server.mapping.*;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyServerPermeateServerMappingDTO;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.server.permeate.server.mapping.LazyNettyServerPermeateServerMapping;
@ -52,7 +52,7 @@ public class LazyServerPermeateServerMappingApplicationImpl implements LazyServe
@Override
public Result<LazyNettyServerPermeateServerMapping> story(LazyServerPermeateServerMappingStoryCommand lazyServerPermeateServerMappingStoryCommand) {
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingStoryCommand);
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingStoryCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateServerMapping.setServerId(serverId);
// 开启端口
@ -75,7 +75,7 @@ public class LazyServerPermeateServerMappingApplicationImpl implements LazyServe
@Override
public Result<List<LazyNettyServerPermeateServerMapping>> batchStory(List<LazyServerPermeateServerMappingStoryCommand> lazyServerPermeateServerMappingStoryCommandList) {
List<LazyNettyServerPermeateServerMapping> lazyNettyServerPermeateServerMappingList = lazyServerPermeateServerMappingStoryCommandList.stream().map(LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE::toLazyInternalNetworkServerPermeateMapping).collect(Collectors.toList());
List<LazyNettyServerPermeateServerMapping> lazyNettyServerPermeateServerMappingList = lazyServerPermeateServerMappingStoryCommandList.stream().map(LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE::toLazyInternalNetworkServerPermeateMapping).collect(Collectors.toList());
for (LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping : lazyNettyServerPermeateServerMappingList) {
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateServerMapping.setServerId(serverId);
@ -100,7 +100,7 @@ public class LazyServerPermeateServerMappingApplicationImpl implements LazyServe
@Override
public Result<LazyNettyServerPermeateServerMapping> updateOne(LazyServerPermeateServerMappingUpdateCommand lazyServerPermeateServerMappingUpdateCommand) {
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingUpdateCommand);
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingUpdateCommand);
String serverId = serverNodeProperties.getNodeId();
lazyNettyServerPermeateServerMapping.setServerId(serverId);
// 开启端口
@ -123,8 +123,8 @@ public class LazyServerPermeateServerMappingApplicationImpl implements LazyServe
@Override
public Result<LazyServerPermeateServerMappingDTO> findOne(LazyServerPermeateServerMappingQueryOneCommand lazyServerPermeateServerMappingQueryOneCommand) {
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingQueryOneCommand);
return lazyNettyServerPermeateServerMappingRepository.findOne(lazyNettyServerPermeateServerMapping).convert(LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkServerPermeateMapping);
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingQueryOneCommand);
return lazyNettyServerPermeateServerMappingRepository.findOne(lazyNettyServerPermeateServerMapping).convert(LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkServerPermeateMapping);
}
/**
@ -138,8 +138,8 @@ public class LazyServerPermeateServerMappingApplicationImpl implements LazyServe
@Override
public Result<List<LazyServerPermeateServerMappingDTO>> findList(LazyServerPermeateServerMappingQueryListCommand lazyServerPermeateServerMappingQueryListCommand) {
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingQueryListCommand);
return lazyNettyServerPermeateServerMappingRepository.findList(lazyNettyServerPermeateServerMapping).convert(lazyInternalNetworkServerPermeateMappings -> lazyInternalNetworkServerPermeateMappings.stream().map(LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkServerPermeateMapping).collect(Collectors.toList()));
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingQueryListCommand);
return lazyNettyServerPermeateServerMappingRepository.findList(lazyNettyServerPermeateServerMapping).convert(lazyInternalNetworkServerPermeateMappings -> lazyInternalNetworkServerPermeateMappings.stream().map(LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkServerPermeateMapping).collect(Collectors.toList()));
}
/**
@ -153,8 +153,8 @@ public class LazyServerPermeateServerMappingApplicationImpl implements LazyServe
@Override
public Result<LazyPage<LazyServerPermeateServerMappingDTO>> findPage(int size, int current, LazyServerPermeateServerMappingQueryListCommand lazyServerPermeateServerMappingQueryListCommand) {
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingQueryListCommand);
return lazyNettyServerPermeateServerMappingRepository.findPage(size, current, lazyNettyServerPermeateServerMapping).convert(page -> page.convert(LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkServerPermeateMapping));
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingQueryListCommand);
return lazyNettyServerPermeateServerMappingRepository.findPage(size, current, lazyNettyServerPermeateServerMapping).convert(page -> page.convert(LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE::fromLazyInternalNetworkServerPermeateMapping));
}
/**
@ -168,7 +168,7 @@ public class LazyServerPermeateServerMappingApplicationImpl implements LazyServe
@Override
public Result<LazyNettyServerPermeateServerMapping> remove(LazyServerPermeateServerMappingRemoveCommand lazyServerPermeateServerMappingRemoveCommand) {
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyInternalNetworkServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingRemoveCommand);
LazyNettyServerPermeateServerMapping lazyNettyServerPermeateServerMapping = LazyNettyServerPermeateServerMappingDTOAssembler.INSTANCE.toLazyInternalNetworkServerPermeateMapping(lazyServerPermeateServerMappingRemoveCommand);
// 开启端口
Integer visitorPort = lazyNettyServerPermeateServerMapping.getVisitorPort();
this.closeServerPermeateServerSocket(visitorPort);

View File

@ -12,6 +12,7 @@ spring:
client-id: wujiawei # 客户端ID
app-key: key
app-secret: secret
protocol-type: udp
# inet-host: 124.222.48.62 # 服务端地址
# inet-port: 30676 #服务端端口
# # inet-path: wu-lazy-cloud-heartbeat-server