mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2026-02-04 15:05:54 +08:00
[add] 添加namespace管理
This commit is contained in:
@@ -228,6 +228,7 @@ public class ServerHandleTcpClientConnectSuccessTypeAdvanced extends AbstractHan
|
||||
.getTargetClientId();
|
||||
String targetIp = lazyNettyClientRouteDTO.getTargetIp();
|
||||
String targetPort = lazyNettyClientRouteDTO.getTargetPort();
|
||||
// lazyNettyClientRouteDTO.gets
|
||||
|
||||
ClientProxyRoute clientProxyRoute = new ClientProxyRoute();
|
||||
|
||||
@@ -237,6 +238,7 @@ public class ServerHandleTcpClientConnectSuccessTypeAdvanced extends AbstractHan
|
||||
clientProxyRoute.setTargetIp(targetIp);
|
||||
clientProxyRoute.setTargetPort(targetPort);
|
||||
clientProxyRoute.setRouteType(RouteType.CLIENT_PROXY_CLIENT);
|
||||
// clientProxyRoute.setNamespace();
|
||||
NettyProxyMsg nettyMsg = new NettyProxyMsg();
|
||||
nettyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_);
|
||||
nettyMsg.setData((JSON.toJSONString(clientProxyRoute)
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.application;
|
||||
|
||||
import org.wu.framework.web.response.Result;
|
||||
import org.wu.framework.web.response.ResultFactory;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespace;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceRemoveCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceStoryCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceUpdateCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceQueryListCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceQueryOneCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyNettyNamespaceDTO;
|
||||
import java.util.List;
|
||||
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyApplication
|
||||
**/
|
||||
|
||||
public interface LazyNettyNamespaceApplication {
|
||||
|
||||
|
||||
/**
|
||||
* describe 新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceStoryCommand 新增命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间新增后领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<LazyNettyNamespace> story(LazyNettyNamespaceStoryCommand lazyNettyNamespaceStoryCommand);
|
||||
|
||||
/**
|
||||
* describe 批量新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceStoryCommandList 批量新增命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespace>>} 命名空间新增后领域对象集合
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<List<LazyNettyNamespace>> batchStory(List<LazyNettyNamespaceStoryCommand> lazyNettyNamespaceStoryCommandList);
|
||||
|
||||
/**
|
||||
* describe 更新命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceUpdateCommand 更新命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<LazyNettyNamespace> updateOne(LazyNettyNamespaceUpdateCommand lazyNettyNamespaceUpdateCommand);
|
||||
|
||||
/**
|
||||
* describe 查询单个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryOneCommand 查询单个命名空间
|
||||
* @return {@link Result<LazyNettyNamespaceDTO>} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<LazyNettyNamespaceDTO> findOne(LazyNettyNamespaceQueryOneCommand lazyNettyNamespaceQueryOneCommand);
|
||||
|
||||
/**
|
||||
* describe 查询多个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryListCommand 查询多个命名空间
|
||||
* @return {@link Result <List<LazyNettyNamespaceDTO>>} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result <List<LazyNettyNamespaceDTO>> findList(LazyNettyNamespaceQueryListCommand lazyNettyNamespaceQueryListCommand);
|
||||
|
||||
/**
|
||||
* describe 分页查询多个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryListCommand 分页查询多个命名空间
|
||||
* @return {@link Result <LazyPage<LazyNettyNamespaceDTO>>} 分页命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result <LazyPage<LazyNettyNamespaceDTO>> findPage(int size,int current,LazyNettyNamespaceQueryListCommand lazyNettyNamespaceQueryListCommand);
|
||||
|
||||
/**
|
||||
* describe 删除命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceRemoveCommand 删除命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<LazyNettyNamespace> remove(LazyNettyNamespaceRemoveCommand lazyNettyNamespaceRemoveCommand);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler;
|
||||
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespace;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceRemoveCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceStoryCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceUpdateCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceQueryListCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceQueryOneCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyNettyNamespaceDTO;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.mapstruct.Mapper;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
|
||||
**/
|
||||
@Mapper
|
||||
public interface LazyNettyNamespaceDTOAssembler {
|
||||
|
||||
|
||||
/**
|
||||
* describe MapStruct 创建的代理对象
|
||||
*
|
||||
|
||||
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespaceDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyNamespaceDTOAssembler.class);
|
||||
/**
|
||||
* describe 应用层存储入参转换成 领域对象
|
||||
*
|
||||
* @param lazyNettyNamespaceStoryCommand 保存命名空间对象
|
||||
* @return {@link LazyNettyNamespace} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespace toLazyNettyNamespace(LazyNettyNamespaceStoryCommand lazyNettyNamespaceStoryCommand);
|
||||
/**
|
||||
* describe 应用层更新入参转换成 领域对象
|
||||
*
|
||||
* @param lazyNettyNamespaceUpdateCommand 更新命名空间对象
|
||||
* @return {@link LazyNettyNamespace} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespace toLazyNettyNamespace(LazyNettyNamespaceUpdateCommand lazyNettyNamespaceUpdateCommand);
|
||||
/**
|
||||
* describe 应用层查询入参转换成 领域对象
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryOneCommand 查询单个命名空间对象参数
|
||||
* @return {@link LazyNettyNamespace} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespace toLazyNettyNamespace(LazyNettyNamespaceQueryOneCommand lazyNettyNamespaceQueryOneCommand);
|
||||
/**
|
||||
* describe 应用层查询入参转换成 领域对象
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryListCommand 查询集合命名空间对象参数
|
||||
* @return {@link LazyNettyNamespace} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespace toLazyNettyNamespace(LazyNettyNamespaceQueryListCommand lazyNettyNamespaceQueryListCommand);
|
||||
/**
|
||||
* describe 应用层删除入参转换成 领域对象
|
||||
*
|
||||
* @param lazyNettyNamespaceRemoveCommand 删除命名空间对象参数
|
||||
* @return {@link LazyNettyNamespace} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespace toLazyNettyNamespace(LazyNettyNamespaceRemoveCommand lazyNettyNamespaceRemoveCommand);
|
||||
/**
|
||||
* describe 持久层领域对象转换成DTO对象
|
||||
*
|
||||
* @param lazyNettyNamespace 命名空间领域对象
|
||||
* @return {@link LazyNettyNamespaceDTO} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespaceDTO fromLazyNettyNamespace(LazyNettyNamespace lazyNettyNamespace);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace;
|
||||
|
||||
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;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyQueryListCommand
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "lazy_netty_namespace_query_List_command",description = "命名空间")
|
||||
public class LazyNettyNamespaceQueryListCommand {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间",name ="createTime",example = "")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description ="描述",name ="description",example = "")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@Schema(description ="id",name ="id",example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace;
|
||||
|
||||
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;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyQueryOneCommand
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "lazy_netty_namespace_query_one_command",description = "命名空间")
|
||||
public class LazyNettyNamespaceQueryOneCommand {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间",name ="createTime",example = "")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description ="描述",name ="description",example = "")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@Schema(description ="id",name ="id",example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace;
|
||||
|
||||
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;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyRemoveCommand
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "lazy_netty_namespace_remove_command",description = "命名空间")
|
||||
public class LazyNettyNamespaceRemoveCommand {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间",name ="createTime",example = "")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description ="描述",name ="description",example = "")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@Schema(description ="id",name ="id",example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace;
|
||||
|
||||
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;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyStoryCommand
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "lazy_netty_namespace_story_command",description = "命名空间")
|
||||
public class LazyNettyNamespaceStoryCommand {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间",name ="createTime",example = "")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description ="描述",name ="description",example = "")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@Schema(description ="id",name ="id",example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace;
|
||||
|
||||
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;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyUpdateCommand
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "lazy_netty_namespace_update_command",description = "命名空间")
|
||||
public class LazyNettyNamespaceUpdateCommand {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间",name ="createTime",example = "")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description ="描述",name ="description",example = "")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@Schema(description ="id",name ="id",example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.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;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDTO
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "lazy_netty_namespace_command_dto",description = "命名空间")
|
||||
public class LazyNettyNamespaceDTO {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间",name ="createTime",example = "")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description ="描述",name ="description",example = "")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@Schema(description ="id",name ="id",example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.application.impl;
|
||||
|
||||
import org.wu.framework.lazy.orm.web.plus.stereotype.LazyApplication;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyNettyNamespaceApplication;
|
||||
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.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespace;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceRemoveCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceStoryCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceUpdateCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceQueryListCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceQueryOneCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.assembler.LazyNettyNamespaceDTOAssembler;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyNettyNamespaceDTO;
|
||||
import java.util.stream.Collectors;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespaceRepository;
|
||||
import java.util.List;
|
||||
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyApplicationImpl
|
||||
**/
|
||||
@LazyApplication
|
||||
public class LazyNettyNamespaceApplicationImpl implements LazyNettyNamespaceApplication {
|
||||
|
||||
@Resource
|
||||
LazyNettyNamespaceRepository lazyNettyNamespaceRepository;
|
||||
/**
|
||||
* describe 新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceStoryCommand 新增命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间新增后领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyNettyNamespace> story(LazyNettyNamespaceStoryCommand lazyNettyNamespaceStoryCommand) {
|
||||
LazyNettyNamespace lazyNettyNamespace = LazyNettyNamespaceDTOAssembler.INSTANCE.toLazyNettyNamespace(lazyNettyNamespaceStoryCommand);
|
||||
return lazyNettyNamespaceRepository.story(lazyNettyNamespace);
|
||||
}
|
||||
/**
|
||||
* describe 批量新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceStoryCommandList 批量新增命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespace>>} 命名空间新增后领域对象集合
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<List<LazyNettyNamespace>> batchStory(List<LazyNettyNamespaceStoryCommand> lazyNettyNamespaceStoryCommandList) {
|
||||
List<LazyNettyNamespace> lazyNettyNamespaceList = lazyNettyNamespaceStoryCommandList.stream().map( LazyNettyNamespaceDTOAssembler.INSTANCE::toLazyNettyNamespace).collect(Collectors.toList());
|
||||
return lazyNettyNamespaceRepository.batchStory(lazyNettyNamespaceList);
|
||||
}
|
||||
/**
|
||||
* describe 更新命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceUpdateCommand 更新命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyNettyNamespace> updateOne(LazyNettyNamespaceUpdateCommand lazyNettyNamespaceUpdateCommand) {
|
||||
LazyNettyNamespace lazyNettyNamespace = LazyNettyNamespaceDTOAssembler.INSTANCE.toLazyNettyNamespace(lazyNettyNamespaceUpdateCommand);
|
||||
return lazyNettyNamespaceRepository.story(lazyNettyNamespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 查询单个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryOneCommand 查询单个命名空间
|
||||
* @return {@link Result<LazyNettyNamespaceDTO>} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyNettyNamespaceDTO> findOne(LazyNettyNamespaceQueryOneCommand lazyNettyNamespaceQueryOneCommand) {
|
||||
LazyNettyNamespace lazyNettyNamespace = LazyNettyNamespaceDTOAssembler.INSTANCE.toLazyNettyNamespace(lazyNettyNamespaceQueryOneCommand);
|
||||
return lazyNettyNamespaceRepository.findOne(lazyNettyNamespace).convert(LazyNettyNamespaceDTOAssembler.INSTANCE::fromLazyNettyNamespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 查询多个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryListCommand 查询多个命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespaceDTO>>} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<List<LazyNettyNamespaceDTO>> findList(LazyNettyNamespaceQueryListCommand lazyNettyNamespaceQueryListCommand) {
|
||||
LazyNettyNamespace lazyNettyNamespace = LazyNettyNamespaceDTOAssembler.INSTANCE.toLazyNettyNamespace(lazyNettyNamespaceQueryListCommand);
|
||||
return lazyNettyNamespaceRepository.findList(lazyNettyNamespace) .convert(lazyNettyNamespaces -> lazyNettyNamespaces.stream().map(LazyNettyNamespaceDTOAssembler.INSTANCE::fromLazyNettyNamespace).collect(Collectors.toList())) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 分页查询多个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryListCommand 分页查询多个命名空间
|
||||
* @return {@link Result<LazyPage<LazyNettyNamespaceDTO>>} 分页命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyPage<LazyNettyNamespaceDTO>> findPage(int size,int current,LazyNettyNamespaceQueryListCommand lazyNettyNamespaceQueryListCommand) {
|
||||
LazyNettyNamespace lazyNettyNamespace = LazyNettyNamespaceDTOAssembler.INSTANCE.toLazyNettyNamespace(lazyNettyNamespaceQueryListCommand);
|
||||
return lazyNettyNamespaceRepository.findPage(size,current,lazyNettyNamespace) .convert(page -> page.convert(LazyNettyNamespaceDTOAssembler.INSTANCE::fromLazyNettyNamespace)) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 删除命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceRemoveCommand 删除命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyNettyNamespace> remove(LazyNettyNamespaceRemoveCommand lazyNettyNamespaceRemoveCommand) {
|
||||
LazyNettyNamespace lazyNettyNamespace = LazyNettyNamespaceDTOAssembler.INSTANCE.toLazyNettyNamespace(lazyNettyNamespaceRemoveCommand);
|
||||
return lazyNettyNamespaceRepository.remove(lazyNettyNamespace);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.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.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespace;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceRemoveCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceStoryCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceUpdateCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceQueryListCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.namespace.LazyNettyNamespaceQueryOneCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyNettyNamespaceApplication;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyNettyNamespaceDTO;
|
||||
import java.util.List;
|
||||
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController
|
||||
**/
|
||||
@Tag(name = "命名空间提供者")
|
||||
@EasyController("/lazy/netty/namespace")
|
||||
public class LazyNettyNamespaceProvider {
|
||||
|
||||
@Resource
|
||||
private LazyNettyNamespaceApplication lazyNettyNamespaceApplication;
|
||||
|
||||
/**
|
||||
* describe 新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceStoryCommand 新增命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间新增后领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Operation(summary = "新增命名空间")
|
||||
@PostMapping("/story")
|
||||
public Result<LazyNettyNamespace> story(@RequestBody LazyNettyNamespaceStoryCommand lazyNettyNamespaceStoryCommand){
|
||||
return lazyNettyNamespaceApplication.story(lazyNettyNamespaceStoryCommand);
|
||||
}
|
||||
/**
|
||||
* describe 批量新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceStoryCommandList 批量新增命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespace>>} 命名空间新增后领域对象集合
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Operation(summary = "批量新增命名空间")
|
||||
@PostMapping("/batchStory")
|
||||
public Result<List<LazyNettyNamespace>> batchStory(@RequestBody List<LazyNettyNamespaceStoryCommand> lazyNettyNamespaceStoryCommandList){
|
||||
return lazyNettyNamespaceApplication.batchStory(lazyNettyNamespaceStoryCommandList);
|
||||
}
|
||||
/**
|
||||
* describe 更新命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceUpdateCommand 更新命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Operation(summary = "更新命名空间")
|
||||
@PutMapping("/updateOne")
|
||||
public Result<LazyNettyNamespace> updateOne(@RequestBody LazyNettyNamespaceUpdateCommand lazyNettyNamespaceUpdateCommand){
|
||||
return lazyNettyNamespaceApplication.updateOne(lazyNettyNamespaceUpdateCommand);
|
||||
}
|
||||
/**
|
||||
* describe 查询单个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryOneCommand 查询单个命名空间
|
||||
* @return {@link Result<LazyNettyNamespaceDTO>} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Operation(summary = "查询单个命名空间")
|
||||
@GetMapping("/findOne")
|
||||
public Result<LazyNettyNamespaceDTO> findOne(@ModelAttribute LazyNettyNamespaceQueryOneCommand lazyNettyNamespaceQueryOneCommand){
|
||||
return lazyNettyNamespaceApplication.findOne(lazyNettyNamespaceQueryOneCommand);
|
||||
}
|
||||
/**
|
||||
* describe 查询多个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryListCommand 查询多个命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespaceDTO>>} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Operation(summary = "查询多个命名空间")
|
||||
@GetMapping("/findList")
|
||||
public Result<List<LazyNettyNamespaceDTO>> findList(@ModelAttribute LazyNettyNamespaceQueryListCommand lazyNettyNamespaceQueryListCommand){
|
||||
return lazyNettyNamespaceApplication.findList(lazyNettyNamespaceQueryListCommand);
|
||||
}
|
||||
/**
|
||||
* describe 分页查询多个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceQueryListCommand 分页查询多个命名空间
|
||||
* @return {@link Result<LazyPage<LazyNettyNamespaceDTO>>} 分页命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Operation(summary = "分页查询多个命名空间")
|
||||
@GetMapping("/findPage")
|
||||
public Result<LazyPage<LazyNettyNamespaceDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
|
||||
@Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute LazyNettyNamespaceQueryListCommand lazyNettyNamespaceQueryListCommand){
|
||||
return lazyNettyNamespaceApplication.findPage(size,current,lazyNettyNamespaceQueryListCommand);
|
||||
}
|
||||
/**
|
||||
* describe 删除命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceRemoveCommand 删除命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Operation(summary = "删除命名空间")
|
||||
@DeleteMapping("/remove")
|
||||
public Result<LazyNettyNamespace> remove(@ModelAttribute LazyNettyNamespaceRemoveCommand lazyNettyNamespaceRemoveCommand){
|
||||
return lazyNettyNamespaceApplication.remove(lazyNettyNamespaceRemoveCommand);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.namespace;
|
||||
|
||||
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;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDomain
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "lazy_netty_namespace",description = "命名空间")
|
||||
public class LazyNettyNamespace {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间",name ="createTime",example = "")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description ="描述",name ="description",example = "")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@Schema(description ="id",name ="id",example = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.namespace;
|
||||
|
||||
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.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespace;
|
||||
import java.util.List;
|
||||
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDomainRepository
|
||||
**/
|
||||
|
||||
public interface LazyNettyNamespaceRepository {
|
||||
|
||||
|
||||
/**
|
||||
* describe 新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 新增命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间新增后领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<LazyNettyNamespace> story(LazyNettyNamespace lazyNettyNamespace);
|
||||
|
||||
/**
|
||||
* describe 批量新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceList 批量新增命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespace>>} 命名空间新增后领域对象集合
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<List<LazyNettyNamespace>> batchStory(List<LazyNettyNamespace> lazyNettyNamespaceList);
|
||||
|
||||
/**
|
||||
* describe 查询单个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 查询单个命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<LazyNettyNamespace> findOne(LazyNettyNamespace lazyNettyNamespace);
|
||||
|
||||
/**
|
||||
* describe 查询多个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 查询多个命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespace>>} 命名空间DTO对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<List<LazyNettyNamespace>> findList(LazyNettyNamespace lazyNettyNamespace);
|
||||
|
||||
/**
|
||||
* describe 分页查询多个命名空间
|
||||
*
|
||||
* @param size 当前页数
|
||||
* @param current 当前页
|
||||
* @param lazyNettyNamespace 分页查询多个命名空间
|
||||
* @return {@link Result<LazyPage<LazyNettyNamespace>>} 分页命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<LazyPage<LazyNettyNamespace>> findPage(int size,int current,LazyNettyNamespace lazyNettyNamespace);
|
||||
|
||||
/**
|
||||
* describe 删除命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 删除命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<LazyNettyNamespace> remove(LazyNettyNamespace lazyNettyNamespace);
|
||||
|
||||
/**
|
||||
* describe 是否存在命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 是否存在命名空间
|
||||
* @return {@link Result<Boolean>} 命名空间是否存在
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
Result<Boolean> exists(LazyNettyNamespace lazyNettyNamespace);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.converter;
|
||||
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespace;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.entity.LazyNettyNamespaceDO;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.mapstruct.Mapper;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter
|
||||
**/
|
||||
@Mapper
|
||||
public interface LazyNettyNamespaceConverter {
|
||||
|
||||
|
||||
/**
|
||||
* describe MapStruct 创建的代理对象
|
||||
*
|
||||
|
||||
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespaceConverter INSTANCE = Mappers.getMapper(LazyNettyNamespaceConverter.class);
|
||||
/**
|
||||
* describe 实体对象 转换成领域对象
|
||||
*
|
||||
* @param lazyNettyNamespaceDO 命名空间实体对象
|
||||
* @return {@link LazyNettyNamespace} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespace toLazyNettyNamespace(LazyNettyNamespaceDO lazyNettyNamespaceDO);
|
||||
/**
|
||||
* describe 领域对象 转换成实体对象
|
||||
*
|
||||
* @param lazyNettyNamespace 命名空间领域对象
|
||||
* @return {@link LazyNettyNamespaceDO} 命名空间实体对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
LazyNettyNamespaceDO fromLazyNettyNamespace(LazyNettyNamespace lazyNettyNamespace);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.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;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureEntity
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@LazyTable(tableName = "lazy_netty_namespace",comment = "命名空间")
|
||||
@Schema(title = "lazy_netty_namespace",description = "命名空间")
|
||||
public class LazyNettyNamespaceDO {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@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 ="description",example = "")
|
||||
@LazyTableField(name="description",comment="描述",columnType="varchar(255)")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@Schema(description ="id",name ="id",example = "")
|
||||
@LazyTableFieldId(name = "id", comment = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
@LazyTableField(name="namespace",comment="命名空间",columnType="varchar(255)")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.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.server.standalone.infrastructure.entity.LazyNettyNamespaceDO;
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureLazyJpa
|
||||
**/
|
||||
@LazyRepository
|
||||
public interface LazyNettyNamespaceLazyJpaRepository extends LazyJpaRepository<LazyNettyNamespaceDO,Long> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.mapper;
|
||||
|
||||
/**
|
||||
* describe 命名空间
|
||||
*
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureMapper
|
||||
**/
|
||||
|
||||
public interface LazyNettyNamespaceMapper {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.persistence;
|
||||
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.entity.LazyNettyNamespaceDO;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.converter.LazyNettyNamespaceConverter;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.mapper.LazyNettyNamespaceMapper;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespaceRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import java.util.stream.Collectors;
|
||||
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.server.standalone.domain.model.lazy.netty.namespace.LazyNettyNamespace;
|
||||
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/06/14 06:52 晚上
|
||||
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructurePersistence
|
||||
**/
|
||||
@Repository
|
||||
public class LazyNettyNamespaceRepositoryImpl implements LazyNettyNamespaceRepository {
|
||||
|
||||
@Resource
|
||||
LazyLambdaStream lazyLambdaStream;
|
||||
|
||||
/**
|
||||
* describe 新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 新增命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间新增后领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyNettyNamespace> story(LazyNettyNamespace lazyNettyNamespace) {
|
||||
LazyNettyNamespaceDO lazyNettyNamespaceDO = LazyNettyNamespaceConverter.INSTANCE.fromLazyNettyNamespace(lazyNettyNamespace);
|
||||
lazyLambdaStream.upsert(lazyNettyNamespaceDO);
|
||||
return ResultFactory.successOf();
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 批量新增命名空间
|
||||
*
|
||||
* @param lazyNettyNamespaceList 批量新增命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespace>>} 命名空间新增后领域对象集合
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<List<LazyNettyNamespace>> batchStory(List<LazyNettyNamespace> lazyNettyNamespaceList) {
|
||||
List<LazyNettyNamespaceDO> lazyNettyNamespaceDOList = lazyNettyNamespaceList.stream().map(LazyNettyNamespaceConverter.INSTANCE::fromLazyNettyNamespace).collect(Collectors.toList());
|
||||
lazyLambdaStream.upsert(lazyNettyNamespaceDOList);
|
||||
return ResultFactory.successOf();
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 查询单个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 查询单个命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyNettyNamespace> findOne(LazyNettyNamespace lazyNettyNamespace) {
|
||||
LazyNettyNamespaceDO lazyNettyNamespaceDO = LazyNettyNamespaceConverter.INSTANCE.fromLazyNettyNamespace(lazyNettyNamespace);
|
||||
LazyNettyNamespace lazyNettyNamespaceOne = lazyLambdaStream.selectOne(LazyWrappers.lambdaWrapperBean(lazyNettyNamespaceDO), LazyNettyNamespace.class);
|
||||
return ResultFactory.successOf(lazyNettyNamespaceOne);
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 查询多个命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 查询多个命名空间
|
||||
* @return {@link Result<List<LazyNettyNamespace>>} 命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<List<LazyNettyNamespace>> findList(LazyNettyNamespace lazyNettyNamespace) {
|
||||
LazyNettyNamespaceDO lazyNettyNamespaceDO = LazyNettyNamespaceConverter.INSTANCE.fromLazyNettyNamespace(lazyNettyNamespace);
|
||||
List<LazyNettyNamespace> lazyNettyNamespaceList = lazyLambdaStream.selectList(LazyWrappers.lambdaWrapperBean(lazyNettyNamespaceDO), LazyNettyNamespace.class);
|
||||
return ResultFactory.successOf(lazyNettyNamespaceList);
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 分页查询多个命名空间
|
||||
*
|
||||
* @param size 当前页数
|
||||
* @param current 当前页
|
||||
* @param lazyNettyNamespace 分页查询多个命名空间
|
||||
* @return {@link Result<LazyPage<LazyNettyNamespace>>} 分页命名空间领域对象
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyPage<LazyNettyNamespace>> findPage(int size,int current,LazyNettyNamespace lazyNettyNamespace) {
|
||||
LazyNettyNamespaceDO lazyNettyNamespaceDO = LazyNettyNamespaceConverter.INSTANCE.fromLazyNettyNamespace(lazyNettyNamespace);
|
||||
LazyPage<LazyNettyNamespace> lazyPage = new LazyPage<>(current,size);
|
||||
LazyPage<LazyNettyNamespace> lazyNettyNamespaceLazyPage = lazyLambdaStream.selectPage(LazyWrappers.lambdaWrapperBean(lazyNettyNamespaceDO),lazyPage, LazyNettyNamespace.class);
|
||||
return ResultFactory.successOf(lazyNettyNamespaceLazyPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 删除命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 删除命名空间
|
||||
* @return {@link Result<LazyNettyNamespace>} 命名空间
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<LazyNettyNamespace> remove(LazyNettyNamespace lazyNettyNamespace) {
|
||||
LazyNettyNamespaceDO lazyNettyNamespaceDO = LazyNettyNamespaceConverter.INSTANCE.fromLazyNettyNamespace(lazyNettyNamespace);
|
||||
// lazyLambdaStream.delete(LazyWrappers.lambdaWrapperBean(lazyNettyNamespaceDO));
|
||||
return ResultFactory.successOf();
|
||||
}
|
||||
|
||||
/**
|
||||
* describe 是否存在命名空间
|
||||
*
|
||||
* @param lazyNettyNamespace 命名空间领域对象
|
||||
* @return {@link Result<Boolean>} 是否存在 true 存在,false 不存在
|
||||
|
||||
* @author Jia wei Wu
|
||||
* @date 2025/06/14 06:52 晚上
|
||||
**/
|
||||
|
||||
@Override
|
||||
public Result<Boolean> exists(LazyNettyNamespace lazyNettyNamespace) {
|
||||
LazyNettyNamespaceDO lazyNettyNamespaceDO = LazyNettyNamespaceConverter.INSTANCE.fromLazyNettyNamespace(lazyNettyNamespace);
|
||||
Boolean exists=lazyLambdaStream.exists(LazyWrappers.lambdaWrapperBean(lazyNettyNamespaceDO));
|
||||
return ResultFactory.successOf(exists);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
<?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.server.standalone.infrastructure.mapper.LazyNettyNamespaceMapper">
|
||||
<resultMap id="BaseResultMap" type="org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.entity.LazyNettyNamespaceDO">
|
||||
<result column="namespace" property="namespace" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="description" property="description" />
|
||||
<id column="id" property="id" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user