【fix】 添加服务端、客户端路由管理接口

This commit is contained in:
wujiawei 2025-04-05 18:01:23 +08:00
parent 9e1da9649e
commit 8f02c03d42
40 changed files with 2946 additions and 8 deletions

View File

@ -9,7 +9,7 @@ import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.channel.socket.nio.NioSocketChannel;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg; import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.protocol.http.AbstractHttpProtocolHandleChannelRemoteProxyTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpClientProxyClientTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.decoder.TransferDecoder; import org.framework.lazy.cloud.network.heartbeat.common.decoder.TransferDecoder;
import org.framework.lazy.cloud.network.heartbeat.common.encoder.TransferEncoder; import org.framework.lazy.cloud.network.heartbeat.common.encoder.TransferEncoder;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -20,7 +20,7 @@ import org.framework.lazy.cloud.network.heartbeat.protocol.handler.NettyHttpProx
* 客户端客户端远程到服务端客户端远程到客户端 * 客户端客户端远程到服务端客户端远程到客户端
* 服务端服务端远程到客户端 * 服务端服务端远程到客户端
*/ */
public class HttpProtocolHandleChannelRemoteProxyTypeAdvanced extends AbstractHttpProtocolHandleChannelRemoteProxyTypeAdvanced<NettyProxyMsg> { public class HttpClientProxyClientProxyTypeAdvanced extends AbstractHttpClientProxyClientTypeAdvanced<NettyProxyMsg> {
/** /**

View File

@ -9,7 +9,7 @@ import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.channel.socket.nio.NioSocketChannel;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg; import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.protocol.http.AbstractHttpProtocolHandleChannelLocalProxyTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpLocalProxyTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.decoder.TransferDecoder; import org.framework.lazy.cloud.network.heartbeat.common.decoder.TransferDecoder;
import org.framework.lazy.cloud.network.heartbeat.common.encoder.TransferEncoder; import org.framework.lazy.cloud.network.heartbeat.common.encoder.TransferEncoder;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -20,7 +20,7 @@ import org.springframework.stereotype.Component;
* http 本地代理 * http 本地代理
*/ */
@Component @Component
public class HttpProtocolHandleChannelLocalProxyTypeAdvanced extends AbstractHttpProtocolHandleChannelLocalProxyTypeAdvanced<NettyProxyMsg> { public class HttpProtocolHandleChannelLocalProxyTypeAdvanced extends AbstractHttpLocalProxyTypeAdvanced<NettyProxyMsg> {
/** /**

View File

@ -0,0 +1,109 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteRemoveCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteStoryCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteUpdateCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.dto.LazyNettyClientRouteDTO;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyApplication
**/
public interface LazyNettyClientRouteApplication {
/**
* describe 新增客户端代理路由规则
*
* @param lazyNettyClientRouteStoryCommand 新增客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyClientRoute> story(LazyNettyClientRouteStoryCommand lazyNettyClientRouteStoryCommand);
/**
* describe 批量新增客户端代理路由规则
*
* @param lazyNettyClientRouteStoryCommandList 批量新增客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRoute>>} 客户端代理路由规则新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<List<LazyNettyClientRoute>> batchStory(List<LazyNettyClientRouteStoryCommand> lazyNettyClientRouteStoryCommandList);
/**
* describe 更新客户端代理路由规则
*
* @param lazyNettyClientRouteUpdateCommand 更新客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyClientRoute> updateOne(LazyNettyClientRouteUpdateCommand lazyNettyClientRouteUpdateCommand);
/**
* describe 查询单个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryOneCommand 查询单个客户端代理路由规则
* @return {@link Result<LazyNettyClientRouteDTO>} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyClientRouteDTO> findOne(LazyNettyClientRouteQueryOneCommand lazyNettyClientRouteQueryOneCommand);
/**
* describe 查询多个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryListCommand 查询多个客户端代理路由规则
* @return {@link Result <List<LazyNettyClientRouteDTO>>} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result <List<LazyNettyClientRouteDTO>> findList(LazyNettyClientRouteQueryListCommand lazyNettyClientRouteQueryListCommand);
/**
* describe 分页查询多个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryListCommand 分页查询多个客户端代理路由规则
* @return {@link Result <LazyPage<LazyNettyClientRouteDTO>>} 分页客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result <LazyPage<LazyNettyClientRouteDTO>> findPage(int size,int current,LazyNettyClientRouteQueryListCommand lazyNettyClientRouteQueryListCommand);
/**
* describe 删除客户端代理路由规则
*
* @param lazyNettyClientRouteRemoveCommand 删除客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyClientRoute> remove(LazyNettyClientRouteRemoveCommand lazyNettyClientRouteRemoveCommand);
}

View File

@ -0,0 +1,109 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteRemoveCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteStoryCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteUpdateCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.dto.LazyNettyServerRouteDTO;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyApplication
**/
public interface LazyNettyServerRouteApplication {
/**
* describe 新增服务端路由
*
* @param lazyNettyServerRouteStoryCommand 新增服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyServerRoute> story(LazyNettyServerRouteStoryCommand lazyNettyServerRouteStoryCommand);
/**
* describe 批量新增服务端路由
*
* @param lazyNettyServerRouteStoryCommandList 批量新增服务端路由
* @return {@link Result<List<LazyNettyServerRoute>>} 服务端路由新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<List<LazyNettyServerRoute>> batchStory(List<LazyNettyServerRouteStoryCommand> lazyNettyServerRouteStoryCommandList);
/**
* describe 更新服务端路由
*
* @param lazyNettyServerRouteUpdateCommand 更新服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyServerRoute> updateOne(LazyNettyServerRouteUpdateCommand lazyNettyServerRouteUpdateCommand);
/**
* describe 查询单个服务端路由
*
* @param lazyNettyServerRouteQueryOneCommand 查询单个服务端路由
* @return {@link Result<LazyNettyServerRouteDTO>} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyServerRouteDTO> findOne(LazyNettyServerRouteQueryOneCommand lazyNettyServerRouteQueryOneCommand);
/**
* describe 查询多个服务端路由
*
* @param lazyNettyServerRouteQueryListCommand 查询多个服务端路由
* @return {@link Result <List<LazyNettyServerRouteDTO>>} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result <List<LazyNettyServerRouteDTO>> findList(LazyNettyServerRouteQueryListCommand lazyNettyServerRouteQueryListCommand);
/**
* describe 分页查询多个服务端路由
*
* @param lazyNettyServerRouteQueryListCommand 分页查询多个服务端路由
* @return {@link Result <LazyPage<LazyNettyServerRouteDTO>>} 分页服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result <LazyPage<LazyNettyServerRouteDTO>> findPage(int size,int current,LazyNettyServerRouteQueryListCommand lazyNettyServerRouteQueryListCommand);
/**
* describe 删除服务端路由
*
* @param lazyNettyServerRouteRemoveCommand 删除服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyServerRoute> remove(LazyNettyServerRouteRemoveCommand lazyNettyServerRouteRemoveCommand);
}

View File

@ -0,0 +1,93 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.assembler;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteRemoveCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteStoryCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteUpdateCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.dto.LazyNettyClientRouteDTO;
import org.mapstruct.factory.Mappers;
import org.mapstruct.Mapper;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
**/
@Mapper
public interface LazyNettyClientRouteDTOAssembler {
/**
* describe MapStruct 创建的代理对象
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRouteDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyClientRouteDTOAssembler.class);
/**
* describe 应用层存储入参转换成 领域对象
*
* @param lazyNettyClientRouteStoryCommand 保存客户端代理路由规则对象
* @return {@link LazyNettyClientRoute} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRoute toLazyNettyClientRoute(LazyNettyClientRouteStoryCommand lazyNettyClientRouteStoryCommand);
/**
* describe 应用层更新入参转换成 领域对象
*
* @param lazyNettyClientRouteUpdateCommand 更新客户端代理路由规则对象
* @return {@link LazyNettyClientRoute} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRoute toLazyNettyClientRoute(LazyNettyClientRouteUpdateCommand lazyNettyClientRouteUpdateCommand);
/**
* describe 应用层查询入参转换成 领域对象
*
* @param lazyNettyClientRouteQueryOneCommand 查询单个客户端代理路由规则对象参数
* @return {@link LazyNettyClientRoute} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRoute toLazyNettyClientRoute(LazyNettyClientRouteQueryOneCommand lazyNettyClientRouteQueryOneCommand);
/**
* describe 应用层查询入参转换成 领域对象
*
* @param lazyNettyClientRouteQueryListCommand 查询集合客户端代理路由规则对象参数
* @return {@link LazyNettyClientRoute} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRoute toLazyNettyClientRoute(LazyNettyClientRouteQueryListCommand lazyNettyClientRouteQueryListCommand);
/**
* describe 应用层删除入参转换成 领域对象
*
* @param lazyNettyClientRouteRemoveCommand 删除客户端代理路由规则对象参数
* @return {@link LazyNettyClientRoute} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRoute toLazyNettyClientRoute(LazyNettyClientRouteRemoveCommand lazyNettyClientRouteRemoveCommand);
/**
* describe 持久层领域对象转换成DTO对象
*
* @param lazyNettyClientRoute 客户端代理路由规则领域对象
* @return {@link LazyNettyClientRouteDTO} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRouteDTO fromLazyNettyClientRoute(LazyNettyClientRoute lazyNettyClientRoute);
}

View File

@ -0,0 +1,93 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.assembler;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteRemoveCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteStoryCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteUpdateCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.dto.LazyNettyServerRouteDTO;
import org.mapstruct.factory.Mappers;
import org.mapstruct.Mapper;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
**/
@Mapper
public interface LazyNettyServerRouteDTOAssembler {
/**
* describe MapStruct 创建的代理对象
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRouteDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyServerRouteDTOAssembler.class);
/**
* describe 应用层存储入参转换成 领域对象
*
* @param lazyNettyServerRouteStoryCommand 保存服务端路由对象
* @return {@link LazyNettyServerRoute} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRoute toLazyNettyServerRoute(LazyNettyServerRouteStoryCommand lazyNettyServerRouteStoryCommand);
/**
* describe 应用层更新入参转换成 领域对象
*
* @param lazyNettyServerRouteUpdateCommand 更新服务端路由对象
* @return {@link LazyNettyServerRoute} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRoute toLazyNettyServerRoute(LazyNettyServerRouteUpdateCommand lazyNettyServerRouteUpdateCommand);
/**
* describe 应用层查询入参转换成 领域对象
*
* @param lazyNettyServerRouteQueryOneCommand 查询单个服务端路由对象参数
* @return {@link LazyNettyServerRoute} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRoute toLazyNettyServerRoute(LazyNettyServerRouteQueryOneCommand lazyNettyServerRouteQueryOneCommand);
/**
* describe 应用层查询入参转换成 领域对象
*
* @param lazyNettyServerRouteQueryListCommand 查询集合服务端路由对象参数
* @return {@link LazyNettyServerRoute} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRoute toLazyNettyServerRoute(LazyNettyServerRouteQueryListCommand lazyNettyServerRouteQueryListCommand);
/**
* describe 应用层删除入参转换成 领域对象
*
* @param lazyNettyServerRouteRemoveCommand 删除服务端路由对象参数
* @return {@link LazyNettyServerRoute} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRoute toLazyNettyServerRoute(LazyNettyServerRouteRemoveCommand lazyNettyServerRouteRemoveCommand);
/**
* describe 持久层领域对象转换成DTO对象
*
* @param lazyNettyServerRoute 服务端路由领域对象
* @return {@link LazyNettyServerRouteDTO} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRouteDTO fromLazyNettyServerRoute(LazyNettyServerRoute lazyNettyServerRoute);
}

View File

@ -0,0 +1,79 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyQueryListCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_client_route_query_List_command",description = "客户端代理路由规则")
public class LazyNettyClientRouteQueryListCommand {
/**
*
* 客户端ID
*/
@Schema(description ="客户端ID",name ="clientId",example = "")
private String clientId;
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,79 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyQueryOneCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_client_route_query_one_command",description = "客户端代理路由规则")
public class LazyNettyClientRouteQueryOneCommand {
/**
*
* 客户端ID
*/
@Schema(description ="客户端ID",name ="clientId",example = "")
private String clientId;
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,79 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyRemoveCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_client_route_remove_command",description = "客户端代理路由规则")
public class LazyNettyClientRouteRemoveCommand {
/**
*
* 客户端ID
*/
@Schema(description ="客户端ID",name ="clientId",example = "")
private String clientId;
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,73 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyStoryCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_client_route_story_command",description = "客户端代理路由规则")
public class LazyNettyClientRouteStoryCommand {
/**
*
* 客户端ID
*/
@Schema(description ="客户端ID",name ="clientId",example = "")
private String clientId;
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,79 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyUpdateCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_client_route_update_command",description = "客户端代理路由规则")
public class LazyNettyClientRouteUpdateCommand {
/**
*
* 客户端ID
*/
@Schema(description ="客户端ID",name ="clientId",example = "")
private String clientId;
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,72 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.lang.String;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyQueryListCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_server_route_query_List_command",description = "服务端路由")
public class LazyNettyServerRouteQueryListCommand {
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,72 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.lang.String;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyQueryOneCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_server_route_query_one_command",description = "服务端路由")
public class LazyNettyServerRouteQueryOneCommand {
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,72 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.lang.String;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyRemoveCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_server_route_remove_command",description = "服务端路由")
public class LazyNettyServerRouteRemoveCommand {
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,66 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.lang.String;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyStoryCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_server_route_story_command",description = "服务端路由")
public class LazyNettyServerRouteStoryCommand {
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,72 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.lang.String;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyUpdateCommand
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_server_route_update_command",description = "服务端路由")
public class LazyNettyServerRouteUpdateCommand {
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,79 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDTO
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_client_route_command_dto",description = "客户端代理路由规则")
public class LazyNettyClientRouteDTO {
/**
*
* 客户端ID
*/
@Schema(description ="客户端ID",name ="clientId",example = "")
private String clientId;
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,72 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.lang.String;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDTO
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_server_route_command_dto",description = "服务端路由")
public class LazyNettyServerRouteDTO {
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,144 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.impl;
import org.wu.framework.database.lazy.web.plus.stereotype.LazyApplication;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.LazyNettyClientRouteApplication;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteRemoveCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteStoryCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteUpdateCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.assembler.LazyNettyClientRouteDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.dto.LazyNettyClientRouteDTO;
import java.util.stream.Collectors;
import jakarta.annotation.Resource;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRouteRepository;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyApplicationImpl
**/
@LazyApplication
public class LazyNettyClientRouteApplicationImpl implements LazyNettyClientRouteApplication {
@Resource
LazyNettyClientRouteRepository lazyNettyClientRouteRepository;
/**
* describe 新增客户端代理路由规则
*
* @param lazyNettyClientRouteStoryCommand 新增客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyClientRoute> story(LazyNettyClientRouteStoryCommand lazyNettyClientRouteStoryCommand) {
LazyNettyClientRoute lazyNettyClientRoute = LazyNettyClientRouteDTOAssembler.INSTANCE.toLazyNettyClientRoute(lazyNettyClientRouteStoryCommand);
return lazyNettyClientRouteRepository.story(lazyNettyClientRoute);
}
/**
* describe 批量新增客户端代理路由规则
*
* @param lazyNettyClientRouteStoryCommandList 批量新增客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRoute>>} 客户端代理路由规则新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<List<LazyNettyClientRoute>> batchStory(List<LazyNettyClientRouteStoryCommand> lazyNettyClientRouteStoryCommandList) {
List<LazyNettyClientRoute> lazyNettyClientRouteList = lazyNettyClientRouteStoryCommandList.stream().map( LazyNettyClientRouteDTOAssembler.INSTANCE::toLazyNettyClientRoute).collect(Collectors.toList());
return lazyNettyClientRouteRepository.batchStory(lazyNettyClientRouteList);
}
/**
* describe 更新客户端代理路由规则
*
* @param lazyNettyClientRouteUpdateCommand 更新客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyClientRoute> updateOne(LazyNettyClientRouteUpdateCommand lazyNettyClientRouteUpdateCommand) {
LazyNettyClientRoute lazyNettyClientRoute = LazyNettyClientRouteDTOAssembler.INSTANCE.toLazyNettyClientRoute(lazyNettyClientRouteUpdateCommand);
return lazyNettyClientRouteRepository.story(lazyNettyClientRoute);
}
/**
* describe 查询单个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryOneCommand 查询单个客户端代理路由规则
* @return {@link Result<LazyNettyClientRouteDTO>} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyClientRouteDTO> findOne(LazyNettyClientRouteQueryOneCommand lazyNettyClientRouteQueryOneCommand) {
LazyNettyClientRoute lazyNettyClientRoute = LazyNettyClientRouteDTOAssembler.INSTANCE.toLazyNettyClientRoute(lazyNettyClientRouteQueryOneCommand);
return lazyNettyClientRouteRepository.findOne(lazyNettyClientRoute).convert(LazyNettyClientRouteDTOAssembler.INSTANCE::fromLazyNettyClientRoute);
}
/**
* describe 查询多个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryListCommand 查询多个客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRouteDTO>>} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<List<LazyNettyClientRouteDTO>> findList(LazyNettyClientRouteQueryListCommand lazyNettyClientRouteQueryListCommand) {
LazyNettyClientRoute lazyNettyClientRoute = LazyNettyClientRouteDTOAssembler.INSTANCE.toLazyNettyClientRoute(lazyNettyClientRouteQueryListCommand);
return lazyNettyClientRouteRepository.findList(lazyNettyClientRoute) .convert(lazyNettyClientRoutes -> lazyNettyClientRoutes.stream().map(LazyNettyClientRouteDTOAssembler.INSTANCE::fromLazyNettyClientRoute).collect(Collectors.toList())) ;
}
/**
* describe 分页查询多个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryListCommand 分页查询多个客户端代理路由规则
* @return {@link Result<LazyPage<LazyNettyClientRouteDTO>>} 分页客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyPage<LazyNettyClientRouteDTO>> findPage(int size,int current,LazyNettyClientRouteQueryListCommand lazyNettyClientRouteQueryListCommand) {
LazyNettyClientRoute lazyNettyClientRoute = LazyNettyClientRouteDTOAssembler.INSTANCE.toLazyNettyClientRoute(lazyNettyClientRouteQueryListCommand);
return lazyNettyClientRouteRepository.findPage(size,current,lazyNettyClientRoute) .convert(page -> page.convert(LazyNettyClientRouteDTOAssembler.INSTANCE::fromLazyNettyClientRoute)) ;
}
/**
* describe 删除客户端代理路由规则
*
* @param lazyNettyClientRouteRemoveCommand 删除客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyClientRoute> remove(LazyNettyClientRouteRemoveCommand lazyNettyClientRouteRemoveCommand) {
LazyNettyClientRoute lazyNettyClientRoute = LazyNettyClientRouteDTOAssembler.INSTANCE.toLazyNettyClientRoute(lazyNettyClientRouteRemoveCommand);
return lazyNettyClientRouteRepository.remove(lazyNettyClientRoute);
}
}

View File

@ -0,0 +1,144 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.application.impl;
import org.wu.framework.database.lazy.web.plus.stereotype.LazyApplication;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.LazyNettyServerRouteApplication;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteRemoveCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteStoryCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteUpdateCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.assembler.LazyNettyServerRouteDTOAssembler;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.dto.LazyNettyServerRouteDTO;
import java.util.stream.Collectors;
import jakarta.annotation.Resource;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRouteRepository;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyApplicationImpl
**/
@LazyApplication
public class LazyNettyServerRouteApplicationImpl implements LazyNettyServerRouteApplication {
@Resource
LazyNettyServerRouteRepository lazyNettyServerRouteRepository;
/**
* describe 新增服务端路由
*
* @param lazyNettyServerRouteStoryCommand 新增服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyServerRoute> story(LazyNettyServerRouteStoryCommand lazyNettyServerRouteStoryCommand) {
LazyNettyServerRoute lazyNettyServerRoute = LazyNettyServerRouteDTOAssembler.INSTANCE.toLazyNettyServerRoute(lazyNettyServerRouteStoryCommand);
return lazyNettyServerRouteRepository.story(lazyNettyServerRoute);
}
/**
* describe 批量新增服务端路由
*
* @param lazyNettyServerRouteStoryCommandList 批量新增服务端路由
* @return {@link Result<List<LazyNettyServerRoute>>} 服务端路由新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<List<LazyNettyServerRoute>> batchStory(List<LazyNettyServerRouteStoryCommand> lazyNettyServerRouteStoryCommandList) {
List<LazyNettyServerRoute> lazyNettyServerRouteList = lazyNettyServerRouteStoryCommandList.stream().map( LazyNettyServerRouteDTOAssembler.INSTANCE::toLazyNettyServerRoute).collect(Collectors.toList());
return lazyNettyServerRouteRepository.batchStory(lazyNettyServerRouteList);
}
/**
* describe 更新服务端路由
*
* @param lazyNettyServerRouteUpdateCommand 更新服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyServerRoute> updateOne(LazyNettyServerRouteUpdateCommand lazyNettyServerRouteUpdateCommand) {
LazyNettyServerRoute lazyNettyServerRoute = LazyNettyServerRouteDTOAssembler.INSTANCE.toLazyNettyServerRoute(lazyNettyServerRouteUpdateCommand);
return lazyNettyServerRouteRepository.story(lazyNettyServerRoute);
}
/**
* describe 查询单个服务端路由
*
* @param lazyNettyServerRouteQueryOneCommand 查询单个服务端路由
* @return {@link Result<LazyNettyServerRouteDTO>} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyServerRouteDTO> findOne(LazyNettyServerRouteQueryOneCommand lazyNettyServerRouteQueryOneCommand) {
LazyNettyServerRoute lazyNettyServerRoute = LazyNettyServerRouteDTOAssembler.INSTANCE.toLazyNettyServerRoute(lazyNettyServerRouteQueryOneCommand);
return lazyNettyServerRouteRepository.findOne(lazyNettyServerRoute).convert(LazyNettyServerRouteDTOAssembler.INSTANCE::fromLazyNettyServerRoute);
}
/**
* describe 查询多个服务端路由
*
* @param lazyNettyServerRouteQueryListCommand 查询多个服务端路由
* @return {@link Result<List<LazyNettyServerRouteDTO>>} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<List<LazyNettyServerRouteDTO>> findList(LazyNettyServerRouteQueryListCommand lazyNettyServerRouteQueryListCommand) {
LazyNettyServerRoute lazyNettyServerRoute = LazyNettyServerRouteDTOAssembler.INSTANCE.toLazyNettyServerRoute(lazyNettyServerRouteQueryListCommand);
return lazyNettyServerRouteRepository.findList(lazyNettyServerRoute) .convert(lazyNettyServerRoutes -> lazyNettyServerRoutes.stream().map(LazyNettyServerRouteDTOAssembler.INSTANCE::fromLazyNettyServerRoute).collect(Collectors.toList())) ;
}
/**
* describe 分页查询多个服务端路由
*
* @param lazyNettyServerRouteQueryListCommand 分页查询多个服务端路由
* @return {@link Result<LazyPage<LazyNettyServerRouteDTO>>} 分页服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyPage<LazyNettyServerRouteDTO>> findPage(int size,int current,LazyNettyServerRouteQueryListCommand lazyNettyServerRouteQueryListCommand) {
LazyNettyServerRoute lazyNettyServerRoute = LazyNettyServerRouteDTOAssembler.INSTANCE.toLazyNettyServerRoute(lazyNettyServerRouteQueryListCommand);
return lazyNettyServerRouteRepository.findPage(size,current,lazyNettyServerRoute) .convert(page -> page.convert(LazyNettyServerRouteDTOAssembler.INSTANCE::fromLazyNettyServerRoute)) ;
}
/**
* describe 删除服务端路由
*
* @param lazyNettyServerRouteRemoveCommand 删除服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyServerRoute> remove(LazyNettyServerRouteRemoveCommand lazyNettyServerRouteRemoveCommand) {
LazyNettyServerRoute lazyNettyServerRoute = LazyNettyServerRouteDTOAssembler.INSTANCE.toLazyNettyServerRoute(lazyNettyServerRouteRemoveCommand);
return lazyNettyServerRouteRepository.remove(lazyNettyServerRoute);
}
}

View File

@ -0,0 +1,142 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.wu.framework.web.spring.EasyController;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import jakarta.annotation.Resource;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteRemoveCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteStoryCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteUpdateCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.client.route.LazyNettyClientRouteQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.LazyNettyClientRouteApplication;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.dto.LazyNettyClientRouteDTO;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController
**/
@Tag(name = "客户端代理路由规则提供者")
@EasyController("/lazy/netty/client/route")
public class LazyNettyClientRouteProvider {
@Resource
private LazyNettyClientRouteApplication lazyNettyClientRouteApplication;
/**
* describe 新增客户端代理路由规则
*
* @param lazyNettyClientRouteStoryCommand 新增客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "新增客户端代理路由规则")
@PostMapping("/story")
public Result<LazyNettyClientRoute> story(@RequestBody LazyNettyClientRouteStoryCommand lazyNettyClientRouteStoryCommand){
return lazyNettyClientRouteApplication.story(lazyNettyClientRouteStoryCommand);
}
/**
* describe 批量新增客户端代理路由规则
*
* @param lazyNettyClientRouteStoryCommandList 批量新增客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRoute>>} 客户端代理路由规则新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "批量新增客户端代理路由规则")
@PostMapping("/batchStory")
public Result<List<LazyNettyClientRoute>> batchStory(@RequestBody List<LazyNettyClientRouteStoryCommand> lazyNettyClientRouteStoryCommandList){
return lazyNettyClientRouteApplication.batchStory(lazyNettyClientRouteStoryCommandList);
}
/**
* describe 更新客户端代理路由规则
*
* @param lazyNettyClientRouteUpdateCommand 更新客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "更新客户端代理路由规则")
@PutMapping("/updateOne")
public Result<LazyNettyClientRoute> updateOne(@RequestBody LazyNettyClientRouteUpdateCommand lazyNettyClientRouteUpdateCommand){
return lazyNettyClientRouteApplication.updateOne(lazyNettyClientRouteUpdateCommand);
}
/**
* describe 查询单个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryOneCommand 查询单个客户端代理路由规则
* @return {@link Result<LazyNettyClientRouteDTO>} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "查询单个客户端代理路由规则")
@GetMapping("/findOne")
public Result<LazyNettyClientRouteDTO> findOne(@ModelAttribute LazyNettyClientRouteQueryOneCommand lazyNettyClientRouteQueryOneCommand){
return lazyNettyClientRouteApplication.findOne(lazyNettyClientRouteQueryOneCommand);
}
/**
* describe 查询多个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryListCommand 查询多个客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRouteDTO>>} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "查询多个客户端代理路由规则")
@GetMapping("/findList")
public Result<List<LazyNettyClientRouteDTO>> findList(@ModelAttribute LazyNettyClientRouteQueryListCommand lazyNettyClientRouteQueryListCommand){
return lazyNettyClientRouteApplication.findList(lazyNettyClientRouteQueryListCommand);
}
/**
* describe 分页查询多个客户端代理路由规则
*
* @param lazyNettyClientRouteQueryListCommand 分页查询多个客户端代理路由规则
* @return {@link Result<LazyPage<LazyNettyClientRouteDTO>>} 分页客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "分页查询多个客户端代理路由规则")
@GetMapping("/findPage")
public Result<LazyPage<LazyNettyClientRouteDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
@Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute LazyNettyClientRouteQueryListCommand lazyNettyClientRouteQueryListCommand){
return lazyNettyClientRouteApplication.findPage(size,current,lazyNettyClientRouteQueryListCommand);
}
/**
* describe 删除客户端代理路由规则
*
* @param lazyNettyClientRouteRemoveCommand 删除客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "删除客户端代理路由规则")
@DeleteMapping("/remove")
public Result<LazyNettyClientRoute> remove(@ModelAttribute LazyNettyClientRouteRemoveCommand lazyNettyClientRouteRemoveCommand){
return lazyNettyClientRouteApplication.remove(lazyNettyClientRouteRemoveCommand);
}
}

View File

@ -0,0 +1,142 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.wu.framework.web.spring.EasyController;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import jakarta.annotation.Resource;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteRemoveCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteStoryCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteUpdateCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.command.lazy.netty.server.route.LazyNettyServerRouteQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.LazyNettyServerRouteApplication;
import org.framework.lazy.cloud.network.heartbeat.protocol.application.dto.LazyNettyServerRouteDTO;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController
**/
@Tag(name = "服务端路由提供者")
@EasyController("/lazy/netty/server/route")
public class LazyNettyServerRouteProvider {
@Resource
private LazyNettyServerRouteApplication lazyNettyServerRouteApplication;
/**
* describe 新增服务端路由
*
* @param lazyNettyServerRouteStoryCommand 新增服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "新增服务端路由")
@PostMapping("/story")
public Result<LazyNettyServerRoute> story(@RequestBody LazyNettyServerRouteStoryCommand lazyNettyServerRouteStoryCommand){
return lazyNettyServerRouteApplication.story(lazyNettyServerRouteStoryCommand);
}
/**
* describe 批量新增服务端路由
*
* @param lazyNettyServerRouteStoryCommandList 批量新增服务端路由
* @return {@link Result<List<LazyNettyServerRoute>>} 服务端路由新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "批量新增服务端路由")
@PostMapping("/batchStory")
public Result<List<LazyNettyServerRoute>> batchStory(@RequestBody List<LazyNettyServerRouteStoryCommand> lazyNettyServerRouteStoryCommandList){
return lazyNettyServerRouteApplication.batchStory(lazyNettyServerRouteStoryCommandList);
}
/**
* describe 更新服务端路由
*
* @param lazyNettyServerRouteUpdateCommand 更新服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "更新服务端路由")
@PutMapping("/updateOne")
public Result<LazyNettyServerRoute> updateOne(@RequestBody LazyNettyServerRouteUpdateCommand lazyNettyServerRouteUpdateCommand){
return lazyNettyServerRouteApplication.updateOne(lazyNettyServerRouteUpdateCommand);
}
/**
* describe 查询单个服务端路由
*
* @param lazyNettyServerRouteQueryOneCommand 查询单个服务端路由
* @return {@link Result<LazyNettyServerRouteDTO>} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "查询单个服务端路由")
@GetMapping("/findOne")
public Result<LazyNettyServerRouteDTO> findOne(@ModelAttribute LazyNettyServerRouteQueryOneCommand lazyNettyServerRouteQueryOneCommand){
return lazyNettyServerRouteApplication.findOne(lazyNettyServerRouteQueryOneCommand);
}
/**
* describe 查询多个服务端路由
*
* @param lazyNettyServerRouteQueryListCommand 查询多个服务端路由
* @return {@link Result<List<LazyNettyServerRouteDTO>>} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "查询多个服务端路由")
@GetMapping("/findList")
public Result<List<LazyNettyServerRouteDTO>> findList(@ModelAttribute LazyNettyServerRouteQueryListCommand lazyNettyServerRouteQueryListCommand){
return lazyNettyServerRouteApplication.findList(lazyNettyServerRouteQueryListCommand);
}
/**
* describe 分页查询多个服务端路由
*
* @param lazyNettyServerRouteQueryListCommand 分页查询多个服务端路由
* @return {@link Result<LazyPage<LazyNettyServerRouteDTO>>} 分页服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "分页查询多个服务端路由")
@GetMapping("/findPage")
public Result<LazyPage<LazyNettyServerRouteDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
@Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute LazyNettyServerRouteQueryListCommand lazyNettyServerRouteQueryListCommand){
return lazyNettyServerRouteApplication.findPage(size,current,lazyNettyServerRouteQueryListCommand);
}
/**
* describe 删除服务端路由
*
* @param lazyNettyServerRouteRemoveCommand 删除服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Operation(summary = "删除服务端路由")
@DeleteMapping("/remove")
public Result<LazyNettyServerRoute> remove(@ModelAttribute LazyNettyServerRouteRemoveCommand lazyNettyServerRouteRemoveCommand){
return lazyNettyServerRouteApplication.remove(lazyNettyServerRouteRemoveCommand);
}
}

View File

@ -0,0 +1,79 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDomain
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_client_route",description = "客户端代理路由规则")
public class LazyNettyClientRoute {
/**
*
* 客户端ID
*/
@Schema(description ="客户端ID",name ="clientId",example = "")
private String clientId;
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,106 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRoute;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDomainRepository
**/
public interface LazyNettyClientRouteRepository {
/**
* describe 新增客户端代理路由规则
*
* @param lazyNettyClientRoute 新增客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyClientRoute> story(LazyNettyClientRoute lazyNettyClientRoute);
/**
* describe 批量新增客户端代理路由规则
*
* @param lazyNettyClientRouteList 批量新增客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRoute>>} 客户端代理路由规则新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<List<LazyNettyClientRoute>> batchStory(List<LazyNettyClientRoute> lazyNettyClientRouteList);
/**
* describe 查询单个客户端代理路由规则
*
* @param lazyNettyClientRoute 查询单个客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyClientRoute> findOne(LazyNettyClientRoute lazyNettyClientRoute);
/**
* describe 查询多个客户端代理路由规则
*
* @param lazyNettyClientRoute 查询多个客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRoute>>} 客户端代理路由规则DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<List<LazyNettyClientRoute>> findList(LazyNettyClientRoute lazyNettyClientRoute);
/**
* describe 分页查询多个客户端代理路由规则
*
* @param size 当前页数
* @param current 当前页
* @param lazyNettyClientRoute 分页查询多个客户端代理路由规则
* @return {@link Result<LazyPage<LazyNettyClientRoute>>} 分页客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyPage<LazyNettyClientRoute>> findPage(int size,int current,LazyNettyClientRoute lazyNettyClientRoute);
/**
* describe 删除客户端代理路由规则
*
* @param lazyNettyClientRoute 删除客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyClientRoute> remove(LazyNettyClientRoute lazyNettyClientRoute);
/**
* describe 是否存在客户端代理路由规则
*
* @param lazyNettyClientRoute 是否存在客户端代理路由规则
* @return {@link Result<Boolean>} 客户端代理路由规则是否存在
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<Boolean> exists(LazyNettyClientRoute lazyNettyClientRoute);
}

View File

@ -0,0 +1,72 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.lang.String;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDomain
**/
@Data
@Accessors(chain = true)
@Schema(title = "lazy_netty_server_route",description = "服务端路由")
public class LazyNettyServerRoute {
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,106 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRoute;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDomainRepository
**/
public interface LazyNettyServerRouteRepository {
/**
* describe 新增服务端路由
*
* @param lazyNettyServerRoute 新增服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyServerRoute> story(LazyNettyServerRoute lazyNettyServerRoute);
/**
* describe 批量新增服务端路由
*
* @param lazyNettyServerRouteList 批量新增服务端路由
* @return {@link Result<List<LazyNettyServerRoute>>} 服务端路由新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<List<LazyNettyServerRoute>> batchStory(List<LazyNettyServerRoute> lazyNettyServerRouteList);
/**
* describe 查询单个服务端路由
*
* @param lazyNettyServerRoute 查询单个服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyServerRoute> findOne(LazyNettyServerRoute lazyNettyServerRoute);
/**
* describe 查询多个服务端路由
*
* @param lazyNettyServerRoute 查询多个服务端路由
* @return {@link Result<List<LazyNettyServerRoute>>} 服务端路由DTO对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<List<LazyNettyServerRoute>> findList(LazyNettyServerRoute lazyNettyServerRoute);
/**
* describe 分页查询多个服务端路由
*
* @param size 当前页数
* @param current 当前页
* @param lazyNettyServerRoute 分页查询多个服务端路由
* @return {@link Result<LazyPage<LazyNettyServerRoute>>} 分页服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyPage<LazyNettyServerRoute>> findPage(int size,int current,LazyNettyServerRoute lazyNettyServerRoute);
/**
* describe 删除服务端路由
*
* @param lazyNettyServerRoute 删除服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<LazyNettyServerRoute> remove(LazyNettyServerRoute lazyNettyServerRoute);
/**
* describe 是否存在服务端路由
*
* @param lazyNettyServerRoute 是否存在服务端路由
* @return {@link Result<Boolean>} 服务端路由是否存在
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
Result<Boolean> exists(LazyNettyServerRoute lazyNettyServerRoute);
}

View File

@ -91,8 +91,10 @@ public class NettyHttpProxyHandler extends ChannelInboundHandlerAdapter {
}else { }else {
if(RouteType.LOCAL.equals(route.getRouteType())){ if(RouteType.LOCAL.equals(route.getRouteType())){
proxyMsg.setType(TcpMessageType.HTTP_LOCAL_PROXY); proxyMsg.setType(TcpMessageType.HTTP_LOCAL_PROXY);
}else { }else if (RouteType.CLIENT_PROXY_CLIENT.equals(route.getRouteType())){
proxyMsg.setType(TcpMessageType.HTTP_REMOTE_PROXY); proxyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_CLIENT_);
}else if (RouteType.CLIENT_PROXY_SEVER.equals(route.getRouteType())){
proxyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_);
} }
} }
channelTypeAdapter.handler(ctx.channel(), proxyMsg); channelTypeAdapter.handler(ctx.channel(), proxyMsg);
@ -107,6 +109,12 @@ public class NettyHttpProxyHandler extends ChannelInboundHandlerAdapter {
public void channelInactive(ChannelHandlerContext ctx) throws Exception { public void channelInactive(ChannelHandlerContext ctx) throws Exception {
Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(ctx.channel()); Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(ctx.channel());
if (nextChannel != null) { if (nextChannel != null) {
String visitorId = ChannelAttributeKeyUtils.getVisitorId(ctx.channel());
// close
NettyProxyMsg closeMes=new NettyProxyMsg();
closeMes.setVisitorId(visitorId);
closeMes.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_);
nextChannel.writeAndFlush(closeMes);
closeOnFlush(nextChannel); closeOnFlush(nextChannel);
} }
} }

View File

@ -0,0 +1,48 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.converter;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity.LazyNettyClientRouteDO;
import org.mapstruct.factory.Mappers;
import org.mapstruct.Mapper;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter
**/
@Mapper
public interface LazyNettyClientRouteConverter {
/**
* describe MapStruct 创建的代理对象
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRouteConverter INSTANCE = Mappers.getMapper(LazyNettyClientRouteConverter.class);
/**
* describe 实体对象 转换成领域对象
*
* @param lazyNettyClientRouteDO 客户端代理路由规则实体对象
* @return {@link LazyNettyClientRoute} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRoute toLazyNettyClientRoute(LazyNettyClientRouteDO lazyNettyClientRouteDO);
/**
* describe 领域对象 转换成实体对象
*
* @param lazyNettyClientRoute 客户端代理路由规则领域对象
* @return {@link LazyNettyClientRouteDO} 客户端代理路由规则实体对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyClientRouteDO fromLazyNettyClientRoute(LazyNettyClientRoute lazyNettyClientRoute);
}

View File

@ -0,0 +1,48 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.converter;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity.LazyNettyServerRouteDO;
import org.mapstruct.factory.Mappers;
import org.mapstruct.Mapper;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter
**/
@Mapper
public interface LazyNettyServerRouteConverter {
/**
* describe MapStruct 创建的代理对象
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRouteConverter INSTANCE = Mappers.getMapper(LazyNettyServerRouteConverter.class);
/**
* describe 实体对象 转换成领域对象
*
* @param lazyNettyServerRouteDO 服务端路由实体对象
* @return {@link LazyNettyServerRoute} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRoute toLazyNettyServerRoute(LazyNettyServerRouteDO lazyNettyServerRouteDO);
/**
* describe 领域对象 转换成实体对象
*
* @param lazyNettyServerRoute 服务端路由领域对象
* @return {@link LazyNettyServerRouteDO} 服务端路由实体对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
LazyNettyServerRouteDO fromLazyNettyServerRoute(LazyNettyServerRoute lazyNettyServerRoute);
}

View File

@ -0,0 +1,96 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableIndex;
import org.wu.framework.core.stereotype.LayerField;
import org.wu.framework.core.stereotype.LayerField.LayerFieldType;
import org.wu.framework.lazy.orm.core.stereotype.LazyTable;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableField;
import org.wu.framework.lazy.orm.core.stereotype.*;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import java.lang.String;
import java.time.LocalDateTime;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableFieldId;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureEntity
**/
@Data
@Accessors(chain = true)
@LazyTable(tableName = "lazy_netty_client_route",comment = "客户端代理路由规则")
@Schema(title = "lazy_netty_client_route",description = "客户端代理路由规则")
public class LazyNettyClientRouteDO {
/**
*
* 客户端ID
*/
@Schema(description ="客户端ID",name ="clientId",example = "")
@LazyTableField(name="client_id",comment="客户端ID",notNull=true,columnType="varchar(255)")
private String clientId;
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
@LazyTableField(name="create_time",comment="创建时间",defaultValue="CURRENT_TIMESTAMP",upsertStrategy = LazyFieldStrategy.NEVER,columnType="datetime",extra=" on update CURRENT_TIMESTAMP")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
@LazyTableField(name="describe",comment="规则描述",columnType="varchar(255)")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
@LazyTableFieldId(name = "id", comment = "主键ID")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
@LazyTableField(name="is_deleted",comment="是否删除",notNull=true,defaultValue="'0'",upsertStrategy = LazyFieldStrategy.NEVER,columnType="tinyint(1)")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
@LazyTableField(name="route_ip",comment="路由IP",notNull=true,columnType="varchar(255)")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
@LazyTableField(name="route_port",comment="路由端口默认ALL",notNull=true,defaultValue="'ALL'",upsertStrategy = LazyFieldStrategy.NEVER,columnType="varchar(255)")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
@LazyTableField(name="update_time",comment="更新时间",defaultValue="CURRENT_TIMESTAMP",upsertStrategy = LazyFieldStrategy.NEVER,columnType="datetime",extra=" on update CURRENT_TIMESTAMP")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,88 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableIndex;
import org.wu.framework.core.stereotype.LayerField;
import org.wu.framework.core.stereotype.LayerField.LayerFieldType;
import org.wu.framework.lazy.orm.core.stereotype.LazyTable;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableField;
import org.wu.framework.lazy.orm.core.stereotype.*;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.lang.String;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableFieldId;
import java.lang.Long;
import java.lang.Boolean;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureEntity
**/
@Data
@Accessors(chain = true)
@LazyTable(tableName = "lazy_netty_server_route",comment = "服务端路由")
@Schema(title = "lazy_netty_server_route",description = "服务端路由")
public class LazyNettyServerRouteDO {
/**
*
* 创建时间
*/
@Schema(description ="创建时间",name ="createTime",example = "")
@LazyTableField(name="create_time",comment="创建时间",defaultValue="CURRENT_TIMESTAMP",upsertStrategy = LazyFieldStrategy.NEVER,columnType="datetime",extra=" on update CURRENT_TIMESTAMP")
private LocalDateTime createTime;
/**
*
* 规则描述
*/
@Schema(description ="规则描述",name ="describe",example = "")
@LazyTableField(name="describe",comment="规则描述",columnType="varchar(255)")
private String describe;
/**
*
* 主键ID
*/
@Schema(description ="主键ID",name ="id",example = "")
@LazyTableFieldId(name = "id", comment = "主键ID")
private Long id;
/**
*
* 是否删除
*/
@Schema(description ="是否删除",name ="isDeleted",example = "")
@LazyTableField(name="is_deleted",comment="是否删除",notNull=true,defaultValue="'0'",upsertStrategy = LazyFieldStrategy.NEVER,columnType="tinyint(1)")
private Boolean isDeleted;
/**
*
* 路由IP
*/
@Schema(description ="路由IP",name ="routeIp",example = "")
@LazyTableField(name="route_ip",comment="路由IP",notNull=true,columnType="varchar(255)")
private String routeIp;
/**
*
* 路由端口默认ALL
*/
@Schema(description ="路由端口默认ALL",name ="routePort",example = "")
@LazyTableField(name="route_port",comment="路由端口默认ALL",notNull=true,defaultValue="'ALL'",upsertStrategy = LazyFieldStrategy.NEVER,columnType="varchar(255)")
private String routePort;
/**
*
* 更新时间
*/
@Schema(description ="更新时间",name ="updateTime",example = "")
@LazyTableField(name="update_time",comment="更新时间",defaultValue="CURRENT_TIMESTAMP",upsertStrategy = LazyFieldStrategy.NEVER,columnType="datetime",extra=" on update CURRENT_TIMESTAMP")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,18 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.jpa.lazy;
import org.wu.framework.lazy.orm.database.jpa.repository.LazyJpaRepository;
import org.wu.framework.lazy.orm.database.jpa.repository.annotation.*;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity.LazyNettyClientRouteDO;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureLazyJpa
**/
@LazyRepository
public interface LazyNettyClientRouteLazyJpaRepository extends LazyJpaRepository<LazyNettyClientRouteDO,Long> {
}

View File

@ -0,0 +1,18 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.jpa.lazy;
import org.wu.framework.lazy.orm.database.jpa.repository.LazyJpaRepository;
import org.wu.framework.lazy.orm.database.jpa.repository.annotation.*;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity.LazyNettyServerRouteDO;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureLazyJpa
**/
@LazyRepository
public interface LazyNettyServerRouteLazyJpaRepository extends LazyJpaRepository<LazyNettyServerRouteDO,Long> {
}

View File

@ -0,0 +1,15 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.mapper;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureMapper
**/
public interface LazyNettyClientRouteMapper {
}

View File

@ -0,0 +1,15 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.mapper;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureMapper
**/
public interface LazyNettyServerRouteMapper {
}

View File

@ -0,0 +1,160 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.persistence;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity.LazyNettyClientRouteDO;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.converter.LazyNettyClientRouteConverter;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.mapper.LazyNettyClientRouteMapper;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRouteRepository;
import org.springframework.stereotype.Repository;
import java.util.stream.Collectors;
import org.wu.framework.lazy.orm.database.lambda.stream.wrapper.LazyUpdateSetValueWrappers;
import org.wu.framework.lazy.orm.database.lambda.stream.wrapper.LazyWrappers;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import jakarta.annotation.Resource;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.client.route.LazyNettyClientRoute;
import org.wu.framework.lazy.orm.database.lambda.stream.lambda.LazyLambdaStream;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 客户端代理路由规则
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructurePersistence
**/
@Repository
public class LazyNettyClientRouteRepositoryImpl implements LazyNettyClientRouteRepository {
@Resource
LazyLambdaStream lazyLambdaStream;
/**
* describe 新增客户端代理路由规则
*
* @param lazyNettyClientRoute 新增客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyClientRoute> story(LazyNettyClientRoute lazyNettyClientRoute) {
LazyNettyClientRouteDO lazyNettyClientRouteDO = LazyNettyClientRouteConverter.INSTANCE.fromLazyNettyClientRoute(lazyNettyClientRoute);
lazyLambdaStream.upsert(lazyNettyClientRouteDO);
return ResultFactory.successOf();
}
/**
* describe 批量新增客户端代理路由规则
*
* @param lazyNettyClientRouteList 批量新增客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRoute>>} 客户端代理路由规则新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<List<LazyNettyClientRoute>> batchStory(List<LazyNettyClientRoute> lazyNettyClientRouteList) {
List<LazyNettyClientRouteDO> lazyNettyClientRouteDOList = lazyNettyClientRouteList.stream().map(LazyNettyClientRouteConverter.INSTANCE::fromLazyNettyClientRoute).collect(Collectors.toList());
lazyLambdaStream.upsert(lazyNettyClientRouteDOList);
return ResultFactory.successOf();
}
/**
* describe 查询单个客户端代理路由规则
*
* @param lazyNettyClientRoute 查询单个客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyClientRoute> findOne(LazyNettyClientRoute lazyNettyClientRoute) {
LazyNettyClientRouteDO lazyNettyClientRouteDO = LazyNettyClientRouteConverter.INSTANCE.fromLazyNettyClientRoute(lazyNettyClientRoute);
LazyNettyClientRoute lazyNettyClientRouteOne = lazyLambdaStream.selectOne(LazyWrappers.lambdaWrapperBean(lazyNettyClientRouteDO), LazyNettyClientRoute.class);
return ResultFactory.successOf(lazyNettyClientRouteOne);
}
/**
* describe 查询多个客户端代理路由规则
*
* @param lazyNettyClientRoute 查询多个客户端代理路由规则
* @return {@link Result<List<LazyNettyClientRoute>>} 客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<List<LazyNettyClientRoute>> findList(LazyNettyClientRoute lazyNettyClientRoute) {
LazyNettyClientRouteDO lazyNettyClientRouteDO = LazyNettyClientRouteConverter.INSTANCE.fromLazyNettyClientRoute(lazyNettyClientRoute);
List<LazyNettyClientRoute> lazyNettyClientRouteList = lazyLambdaStream.selectList(LazyWrappers.lambdaWrapperBean(lazyNettyClientRouteDO), LazyNettyClientRoute.class);
return ResultFactory.successOf(lazyNettyClientRouteList);
}
/**
* describe 分页查询多个客户端代理路由规则
*
* @param size 当前页数
* @param current 当前页
* @param lazyNettyClientRoute 分页查询多个客户端代理路由规则
* @return {@link Result<LazyPage<LazyNettyClientRoute>>} 分页客户端代理路由规则领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyPage<LazyNettyClientRoute>> findPage(int size,int current,LazyNettyClientRoute lazyNettyClientRoute) {
LazyNettyClientRouteDO lazyNettyClientRouteDO = LazyNettyClientRouteConverter.INSTANCE.fromLazyNettyClientRoute(lazyNettyClientRoute);
LazyPage<LazyNettyClientRoute> lazyPage = new LazyPage<>(current,size);
LazyPage<LazyNettyClientRoute> lazyNettyClientRouteLazyPage = lazyLambdaStream.selectPage(LazyWrappers.lambdaWrapperBean(lazyNettyClientRouteDO),lazyPage, LazyNettyClientRoute.class);
return ResultFactory.successOf(lazyNettyClientRouteLazyPage);
}
/**
* describe 删除客户端代理路由规则
*
* @param lazyNettyClientRoute 删除客户端代理路由规则
* @return {@link Result<LazyNettyClientRoute>} 客户端代理路由规则
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyClientRoute> remove(LazyNettyClientRoute lazyNettyClientRoute) {
LazyNettyClientRouteDO lazyNettyClientRouteDO = LazyNettyClientRouteConverter.INSTANCE.fromLazyNettyClientRoute(lazyNettyClientRoute);
lazyLambdaStream.update(LazyUpdateSetValueWrappers.<LazyNettyClientRouteDO>lambdaWrapper()
.set(LazyNettyClientRouteDO::getIsDeleted, true),
LazyWrappers
.<LazyNettyClientRouteDO>lambdaWrapper()
.eq(LazyNettyClientRouteDO::getId, lazyNettyClientRoute.getId())
);
return ResultFactory.successOf();
}
/**
* describe 是否存在客户端代理路由规则
*
* @param lazyNettyClientRoute 客户端代理路由规则领域对象
* @return {@link Result<Boolean>} 是否存在 true 存在false 不存在
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<Boolean> exists(LazyNettyClientRoute lazyNettyClientRoute) {
LazyNettyClientRouteDO lazyNettyClientRouteDO = LazyNettyClientRouteConverter.INSTANCE.fromLazyNettyClientRoute(lazyNettyClientRoute);
Boolean exists=lazyLambdaStream.exists(LazyWrappers.lambdaWrapperBean(lazyNettyClientRouteDO));
return ResultFactory.successOf(exists);
}
}

View File

@ -0,0 +1,160 @@
package org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.persistence;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity.LazyNettyServerRouteDO;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.converter.LazyNettyServerRouteConverter;
import org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.mapper.LazyNettyServerRouteMapper;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRouteRepository;
import org.springframework.stereotype.Repository;
import java.util.stream.Collectors;
import org.wu.framework.lazy.orm.database.lambda.stream.wrapper.LazyUpdateSetValueWrappers;
import org.wu.framework.lazy.orm.database.lambda.stream.wrapper.LazyWrappers;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import jakarta.annotation.Resource;
import org.framework.lazy.cloud.network.heartbeat.protocol.domain.model.lazy.netty.server.route.LazyNettyServerRoute;
import org.wu.framework.lazy.orm.database.lambda.stream.lambda.LazyLambdaStream;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
* describe 服务端路由
*
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructurePersistence
**/
@Repository
public class LazyNettyServerRouteRepositoryImpl implements LazyNettyServerRouteRepository {
@Resource
LazyLambdaStream lazyLambdaStream;
/**
* describe 新增服务端路由
*
* @param lazyNettyServerRoute 新增服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由新增后领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyServerRoute> story(LazyNettyServerRoute lazyNettyServerRoute) {
LazyNettyServerRouteDO lazyNettyServerRouteDO = LazyNettyServerRouteConverter.INSTANCE.fromLazyNettyServerRoute(lazyNettyServerRoute);
lazyLambdaStream.upsert(lazyNettyServerRouteDO);
return ResultFactory.successOf();
}
/**
* describe 批量新增服务端路由
*
* @param lazyNettyServerRouteList 批量新增服务端路由
* @return {@link Result<List<LazyNettyServerRoute>>} 服务端路由新增后领域对象集合
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<List<LazyNettyServerRoute>> batchStory(List<LazyNettyServerRoute> lazyNettyServerRouteList) {
List<LazyNettyServerRouteDO> lazyNettyServerRouteDOList = lazyNettyServerRouteList.stream().map(LazyNettyServerRouteConverter.INSTANCE::fromLazyNettyServerRoute).collect(Collectors.toList());
lazyLambdaStream.upsert(lazyNettyServerRouteDOList);
return ResultFactory.successOf();
}
/**
* describe 查询单个服务端路由
*
* @param lazyNettyServerRoute 查询单个服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyServerRoute> findOne(LazyNettyServerRoute lazyNettyServerRoute) {
LazyNettyServerRouteDO lazyNettyServerRouteDO = LazyNettyServerRouteConverter.INSTANCE.fromLazyNettyServerRoute(lazyNettyServerRoute);
LazyNettyServerRoute lazyNettyServerRouteOne = lazyLambdaStream.selectOne(LazyWrappers.lambdaWrapperBean(lazyNettyServerRouteDO), LazyNettyServerRoute.class);
return ResultFactory.successOf(lazyNettyServerRouteOne);
}
/**
* describe 查询多个服务端路由
*
* @param lazyNettyServerRoute 查询多个服务端路由
* @return {@link Result<List<LazyNettyServerRoute>>} 服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<List<LazyNettyServerRoute>> findList(LazyNettyServerRoute lazyNettyServerRoute) {
LazyNettyServerRouteDO lazyNettyServerRouteDO = LazyNettyServerRouteConverter.INSTANCE.fromLazyNettyServerRoute(lazyNettyServerRoute);
List<LazyNettyServerRoute> lazyNettyServerRouteList = lazyLambdaStream.selectList(LazyWrappers.lambdaWrapperBean(lazyNettyServerRouteDO), LazyNettyServerRoute.class);
return ResultFactory.successOf(lazyNettyServerRouteList);
}
/**
* describe 分页查询多个服务端路由
*
* @param size 当前页数
* @param current 当前页
* @param lazyNettyServerRoute 分页查询多个服务端路由
* @return {@link Result<LazyPage<LazyNettyServerRoute>>} 分页服务端路由领域对象
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyPage<LazyNettyServerRoute>> findPage(int size,int current,LazyNettyServerRoute lazyNettyServerRoute) {
LazyNettyServerRouteDO lazyNettyServerRouteDO = LazyNettyServerRouteConverter.INSTANCE.fromLazyNettyServerRoute(lazyNettyServerRoute);
LazyPage<LazyNettyServerRoute> lazyPage = new LazyPage<>(current,size);
LazyPage<LazyNettyServerRoute> lazyNettyServerRouteLazyPage = lazyLambdaStream.selectPage(LazyWrappers.lambdaWrapperBean(lazyNettyServerRouteDO),lazyPage, LazyNettyServerRoute.class);
return ResultFactory.successOf(lazyNettyServerRouteLazyPage);
}
/**
* describe 删除服务端路由
*
* @param lazyNettyServerRoute 删除服务端路由
* @return {@link Result<LazyNettyServerRoute>} 服务端路由
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<LazyNettyServerRoute> remove(LazyNettyServerRoute lazyNettyServerRoute) {
LazyNettyServerRouteDO lazyNettyServerRouteDO = LazyNettyServerRouteConverter.INSTANCE.fromLazyNettyServerRoute(lazyNettyServerRoute);
lazyLambdaStream.update(LazyUpdateSetValueWrappers.<LazyNettyServerRouteDO>lambdaWrapper()
.set(LazyNettyServerRouteDO::getIsDeleted, true),
LazyWrappers
.<LazyNettyServerRouteDO>lambdaWrapper()
.eq(LazyNettyServerRouteDO::getId, lazyNettyServerRoute.getId())
);
return ResultFactory.successOf();
}
/**
* describe 是否存在服务端路由
*
* @param lazyNettyServerRoute 服务端路由领域对象
* @return {@link Result<Boolean>} 是否存在 true 存在false 不存在
* @author Jia wei Wu
* @date 2025/04/05 05:57 下午
**/
@Override
public Result<Boolean> exists(LazyNettyServerRoute lazyNettyServerRoute) {
LazyNettyServerRouteDO lazyNettyServerRouteDO = LazyNettyServerRouteConverter.INSTANCE.fromLazyNettyServerRoute(lazyNettyServerRoute);
Boolean exists=lazyLambdaStream.exists(LazyWrappers.lambdaWrapperBean(lazyNettyServerRouteDO));
return ResultFactory.successOf(exists);
}
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.mapper.LazyNettyClientRouteMapper">
<resultMap id="BaseResultMap" type="org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity.LazyNettyClientRouteDO">
<result column="`describe`" property="describe" />
<result column="create_time" property="createTime" />
<id column="id" property="id" />
<result column="is_deleted" property="isDeleted" />
<result column="update_time" property="updateTime" />
<result column="client_id" property="clientId" />
<result column="route_ip" property="routeIp" />
<result column="route_port" property="routePort" />
</resultMap>
</mapper>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.mapper.LazyNettyServerRouteMapper">
<resultMap id="BaseResultMap" type="org.framework.lazy.cloud.network.heartbeat.protocol.infrastructure.entity.LazyNettyServerRouteDO">
<result column="`describe`" property="describe" />
<result column="create_time" property="createTime" />
<id column="id" property="id" />
<result column="is_deleted" property="isDeleted" />
<result column="update_time" property="updateTime" />
<result column="route_ip" property="routeIp" />
<result column="route_port" property="routePort" />
</resultMap>
</mapper>

View File

@ -7,8 +7,8 @@ import lombok.Getter;
@Getter @Getter
public enum RouteType { public enum RouteType {
LOCAL("本地路由"), LOCAL("本地路由"),
REMOTE_CLIENT("远程客户端路由"), CLIENT_PROXY_CLIENT("客户端远程客户端路由"),
REMOTE_SEVER("远程服务端路由"); CLIENT_PROXY_SEVER("客户端远程服务端路由");
private final String desc; private final String desc;