diff --git a/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/application/assembler/LazyNettyServerPropertiesDTOAssembler.java b/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/application/assembler/LazyNettyServerPropertiesDTOAssembler.java index 424c4ea4..e26afc31 100644 --- a/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/application/assembler/LazyNettyServerPropertiesDTOAssembler.java +++ b/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/application/assembler/LazyNettyServerPropertiesDTOAssembler.java @@ -16,7 +16,7 @@ import org.mapstruct.Mapper; * @date 2024/04/03 03:00 下午 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler **/ -@Mapper +//@Mapper public interface LazyNettyServerPropertiesDTOAssembler { @@ -29,7 +29,8 @@ public interface LazyNettyServerPropertiesDTOAssembler { * @author Jia wei Wu * @date 2024/04/03 03:00 下午 **/ - LazyNettyServerPropertiesDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyServerPropertiesDTOAssembler.class); +// LazyNettyServerPropertiesDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyServerPropertiesDTOAssembler.class); + LazyNettyServerPropertiesDTOAssembler INSTANCE = new LazyNettyServerPropertiesDTOAssemblerImpl(); /** * describe 应用层存储入参转换成 领域对象 * diff --git a/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/application/assembler/LazyNettyServerPropertiesDTOAssemblerImpl.java b/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/application/assembler/LazyNettyServerPropertiesDTOAssemblerImpl.java new file mode 100644 index 00000000..2d48a4b3 --- /dev/null +++ b/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/application/assembler/LazyNettyServerPropertiesDTOAssemblerImpl.java @@ -0,0 +1,141 @@ +package org.framework.lazy.cloud.network.heartbeat.client.application.assembler; + +import org.framework.lazy.cloud.network.heartbeat.client.application.command.lazy.netty.server.properties.*; +import org.framework.lazy.cloud.network.heartbeat.client.application.dto.LazyNettyServerPropertiesDTO; +import org.framework.lazy.cloud.network.heartbeat.client.domain.model.lazy.netty.server.properties.LazyNettyServerProperties; + + +public class LazyNettyServerPropertiesDTOAssemblerImpl implements LazyNettyServerPropertiesDTOAssembler { + + @Override + public LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesStoryCommand lazyNettyServerPropertiesStoryCommand) { + if (lazyNettyServerPropertiesStoryCommand == null) { + return null; + } + + LazyNettyServerProperties lazyNettyServerProperties = new LazyNettyServerProperties(); + + lazyNettyServerProperties.setNamespace(lazyNettyServerPropertiesStoryCommand.getNamespace()); + lazyNettyServerProperties.setClientId(lazyNettyServerPropertiesStoryCommand.getClientId()); + lazyNettyServerProperties.setConnectStatus(lazyNettyServerPropertiesStoryCommand.getConnectStatus()); + lazyNettyServerProperties.setCreateTime(lazyNettyServerPropertiesStoryCommand.getCreateTime()); + lazyNettyServerProperties.setInetHost(lazyNettyServerPropertiesStoryCommand.getInetHost()); + lazyNettyServerProperties.setInetPort(lazyNettyServerPropertiesStoryCommand.getInetPort()); + lazyNettyServerProperties.setType(lazyNettyServerPropertiesStoryCommand.getType()); + lazyNettyServerProperties.setAppKey(lazyNettyServerPropertiesStoryCommand.getAppKey()); + lazyNettyServerProperties.setAppSecret(lazyNettyServerPropertiesStoryCommand.getAppSecret()); + lazyNettyServerProperties.setUpdateTime(lazyNettyServerPropertiesStoryCommand.getUpdateTime()); + + return lazyNettyServerProperties; + } + + @Override + public LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesUpdateCommand lazyNettyServerPropertiesUpdateCommand) { + if (lazyNettyServerPropertiesUpdateCommand == null) { + return null; + } + + LazyNettyServerProperties lazyNettyServerProperties = new LazyNettyServerProperties(); + + lazyNettyServerProperties.setNamespace(lazyNettyServerPropertiesUpdateCommand.getNamespace()); + lazyNettyServerProperties.setClientId(lazyNettyServerPropertiesUpdateCommand.getClientId()); + lazyNettyServerProperties.setConnectStatus(lazyNettyServerPropertiesUpdateCommand.getConnectStatus()); + lazyNettyServerProperties.setCreateTime(lazyNettyServerPropertiesUpdateCommand.getCreateTime()); + lazyNettyServerProperties.setInetHost(lazyNettyServerPropertiesUpdateCommand.getInetHost()); + lazyNettyServerProperties.setInetPort(lazyNettyServerPropertiesUpdateCommand.getInetPort()); + lazyNettyServerProperties.setType(lazyNettyServerPropertiesUpdateCommand.getType()); + lazyNettyServerProperties.setAppKey(lazyNettyServerPropertiesUpdateCommand.getAppKey()); + lazyNettyServerProperties.setAppSecret(lazyNettyServerPropertiesUpdateCommand.getAppSecret()); + lazyNettyServerProperties.setUpdateTime(lazyNettyServerPropertiesUpdateCommand.getUpdateTime()); + + return lazyNettyServerProperties; + } + + @Override + public LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesQueryOneCommand lazyNettyServerPropertiesQueryOneCommand) { + if (lazyNettyServerPropertiesQueryOneCommand == null) { + return null; + } + + LazyNettyServerProperties lazyNettyServerProperties = new LazyNettyServerProperties(); + + lazyNettyServerProperties.setNamespace(lazyNettyServerPropertiesQueryOneCommand.getNamespace()); + lazyNettyServerProperties.setClientId(lazyNettyServerPropertiesQueryOneCommand.getClientId()); + lazyNettyServerProperties.setConnectStatus(lazyNettyServerPropertiesQueryOneCommand.getConnectStatus()); + lazyNettyServerProperties.setCreateTime(lazyNettyServerPropertiesQueryOneCommand.getCreateTime()); + lazyNettyServerProperties.setInetHost(lazyNettyServerPropertiesQueryOneCommand.getInetHost()); + lazyNettyServerProperties.setInetPort(lazyNettyServerPropertiesQueryOneCommand.getInetPort()); + lazyNettyServerProperties.setType(lazyNettyServerPropertiesQueryOneCommand.getType()); + lazyNettyServerProperties.setAppKey(lazyNettyServerPropertiesQueryOneCommand.getAppKey()); + lazyNettyServerProperties.setAppSecret(lazyNettyServerPropertiesQueryOneCommand.getAppSecret()); + lazyNettyServerProperties.setUpdateTime(lazyNettyServerPropertiesQueryOneCommand.getUpdateTime()); + + return lazyNettyServerProperties; + } + + @Override + public LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesQueryListCommand lazyNettyServerPropertiesQueryListCommand) { + if (lazyNettyServerPropertiesQueryListCommand == null) { + return null; + } + + LazyNettyServerProperties lazyNettyServerProperties = new LazyNettyServerProperties(); + + lazyNettyServerProperties.setNamespace(lazyNettyServerPropertiesQueryListCommand.getNamespace()); + lazyNettyServerProperties.setClientId(lazyNettyServerPropertiesQueryListCommand.getClientId()); + lazyNettyServerProperties.setConnectStatus(lazyNettyServerPropertiesQueryListCommand.getConnectStatus()); + lazyNettyServerProperties.setCreateTime(lazyNettyServerPropertiesQueryListCommand.getCreateTime()); + lazyNettyServerProperties.setInetHost(lazyNettyServerPropertiesQueryListCommand.getInetHost()); + lazyNettyServerProperties.setInetPort(lazyNettyServerPropertiesQueryListCommand.getInetPort()); + lazyNettyServerProperties.setType(lazyNettyServerPropertiesQueryListCommand.getType()); + lazyNettyServerProperties.setAppKey(lazyNettyServerPropertiesQueryListCommand.getAppKey()); + lazyNettyServerProperties.setAppSecret(lazyNettyServerPropertiesQueryListCommand.getAppSecret()); + lazyNettyServerProperties.setUpdateTime(lazyNettyServerPropertiesQueryListCommand.getUpdateTime()); + + return lazyNettyServerProperties; + } + + @Override + public LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesRemoveCommand lazyNettyServerPropertiesRemoveCommand) { + if (lazyNettyServerPropertiesRemoveCommand == null) { + return null; + } + + LazyNettyServerProperties lazyNettyServerProperties = new LazyNettyServerProperties(); + + lazyNettyServerProperties.setNamespace(lazyNettyServerPropertiesRemoveCommand.getNamespace()); + lazyNettyServerProperties.setClientId(lazyNettyServerPropertiesRemoveCommand.getClientId()); + lazyNettyServerProperties.setConnectStatus(lazyNettyServerPropertiesRemoveCommand.getConnectStatus()); + lazyNettyServerProperties.setCreateTime(lazyNettyServerPropertiesRemoveCommand.getCreateTime()); + lazyNettyServerProperties.setInetHost(lazyNettyServerPropertiesRemoveCommand.getInetHost()); + lazyNettyServerProperties.setInetPort(lazyNettyServerPropertiesRemoveCommand.getInetPort()); + lazyNettyServerProperties.setType(lazyNettyServerPropertiesRemoveCommand.getType()); + lazyNettyServerProperties.setAppKey(lazyNettyServerPropertiesRemoveCommand.getAppKey()); + lazyNettyServerProperties.setAppSecret(lazyNettyServerPropertiesRemoveCommand.getAppSecret()); + lazyNettyServerProperties.setUpdateTime(lazyNettyServerPropertiesRemoveCommand.getUpdateTime()); + + return lazyNettyServerProperties; + } + + @Override + public LazyNettyServerPropertiesDTO fromLazyNettyServerProperties(LazyNettyServerProperties lazyNettyServerProperties) { + if (lazyNettyServerProperties == null) { + return null; + } + + LazyNettyServerPropertiesDTO lazyNettyServerPropertiesDTO = new LazyNettyServerPropertiesDTO(); + + lazyNettyServerPropertiesDTO.setNamespace(lazyNettyServerProperties.getNamespace()); + lazyNettyServerPropertiesDTO.setClientId(lazyNettyServerProperties.getClientId()); + lazyNettyServerPropertiesDTO.setConnectStatus(lazyNettyServerProperties.getConnectStatus()); + lazyNettyServerPropertiesDTO.setCreateTime(lazyNettyServerProperties.getCreateTime()); + lazyNettyServerPropertiesDTO.setInetHost(lazyNettyServerProperties.getInetHost()); + lazyNettyServerPropertiesDTO.setInetPort(lazyNettyServerProperties.getInetPort()); + lazyNettyServerPropertiesDTO.setType(lazyNettyServerProperties.getType()); + lazyNettyServerPropertiesDTO.setAppKey(lazyNettyServerProperties.getAppKey()); + lazyNettyServerPropertiesDTO.setAppSecret(lazyNettyServerProperties.getAppSecret()); + lazyNettyServerPropertiesDTO.setUpdateTime(lazyNettyServerProperties.getUpdateTime()); + + return lazyNettyServerPropertiesDTO; + } +} diff --git a/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/infrastructure/converter/LazyNettyServerPropertiesConverter.java b/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/infrastructure/converter/LazyNettyServerPropertiesConverter.java index d0dbcddc..40a414b1 100644 --- a/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/infrastructure/converter/LazyNettyServerPropertiesConverter.java +++ b/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/infrastructure/converter/LazyNettyServerPropertiesConverter.java @@ -11,7 +11,7 @@ import org.mapstruct.factory.Mappers; * @date 2024/04/03 03:00 下午 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter **/ -@Mapper +//@Mapper public interface LazyNettyServerPropertiesConverter { @@ -24,7 +24,8 @@ public interface LazyNettyServerPropertiesConverter { * @author Jia wei Wu * @date 2024/04/03 03:00 下午 **/ - LazyNettyServerPropertiesConverter INSTANCE = Mappers.getMapper(LazyNettyServerPropertiesConverter.class); +// LazyNettyServerPropertiesConverter INSTANCE = Mappers.getMapper(LazyNettyServerPropertiesConverter.class); + LazyNettyServerPropertiesConverter INSTANCE = new LazyNettyServerPropertiesConverterImpl(); /** * describe 实体对象 转换成领域对象 * diff --git a/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/infrastructure/converter/LazyNettyServerPropertiesConverterImpl.java b/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/infrastructure/converter/LazyNettyServerPropertiesConverterImpl.java new file mode 100644 index 00000000..3385258c --- /dev/null +++ b/wu-lazy-cloud-heartbeat-client/src/main/java/org/framework/lazy/cloud/network/heartbeat/client/infrastructure/converter/LazyNettyServerPropertiesConverterImpl.java @@ -0,0 +1,54 @@ +package org.framework.lazy.cloud.network.heartbeat.client.infrastructure.converter; + +import org.framework.lazy.cloud.network.heartbeat.client.domain.model.lazy.netty.server.properties.LazyNettyServerProperties; +import org.framework.lazy.cloud.network.heartbeat.client.infrastructure.entity.LazyNettyServerPropertiesDO; + + +public class LazyNettyServerPropertiesConverterImpl implements LazyNettyServerPropertiesConverter { + + @Override + public LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesDO lazyNettyServerPropertiesDO) { + if (lazyNettyServerPropertiesDO == null) { + return null; + } + + LazyNettyServerProperties lazyNettyServerProperties = new LazyNettyServerProperties(); + + lazyNettyServerProperties.setNamespace(lazyNettyServerPropertiesDO.getNamespace()); + lazyNettyServerProperties.setClientId(lazyNettyServerPropertiesDO.getClientId()); + lazyNettyServerProperties.setConnectStatus(lazyNettyServerPropertiesDO.getConnectStatus()); + lazyNettyServerProperties.setCreateTime(lazyNettyServerPropertiesDO.getCreateTime()); + lazyNettyServerProperties.setInetHost(lazyNettyServerPropertiesDO.getInetHost()); + lazyNettyServerProperties.setInetPort(lazyNettyServerPropertiesDO.getInetPort()); + lazyNettyServerProperties.setType(lazyNettyServerPropertiesDO.getType()); + lazyNettyServerProperties.setProtocolType(lazyNettyServerPropertiesDO.getProtocolType()); + lazyNettyServerProperties.setAppKey(lazyNettyServerPropertiesDO.getAppKey()); + lazyNettyServerProperties.setAppSecret(lazyNettyServerPropertiesDO.getAppSecret()); + lazyNettyServerProperties.setUpdateTime(lazyNettyServerPropertiesDO.getUpdateTime()); + + return lazyNettyServerProperties; + } + + @Override + public LazyNettyServerPropertiesDO fromLazyNettyServerProperties(LazyNettyServerProperties lazyNettyServerProperties) { + if (lazyNettyServerProperties == null) { + return null; + } + + LazyNettyServerPropertiesDO lazyNettyServerPropertiesDO = new LazyNettyServerPropertiesDO(); + + lazyNettyServerPropertiesDO.setNamespace(lazyNettyServerProperties.getNamespace()); + lazyNettyServerPropertiesDO.setClientId(lazyNettyServerProperties.getClientId()); + lazyNettyServerPropertiesDO.setConnectStatus(lazyNettyServerProperties.getConnectStatus()); + lazyNettyServerPropertiesDO.setCreateTime(lazyNettyServerProperties.getCreateTime()); + lazyNettyServerPropertiesDO.setInetHost(lazyNettyServerProperties.getInetHost()); + lazyNettyServerPropertiesDO.setInetPort(lazyNettyServerProperties.getInetPort()); + lazyNettyServerPropertiesDO.setAppKey(lazyNettyServerProperties.getAppKey()); + lazyNettyServerPropertiesDO.setAppSecret(lazyNettyServerProperties.getAppSecret()); + lazyNettyServerPropertiesDO.setType(lazyNettyServerProperties.getType()); + lazyNettyServerPropertiesDO.setProtocolType(lazyNettyServerProperties.getProtocolType()); + lazyNettyServerPropertiesDO.setUpdateTime(lazyNettyServerProperties.getUpdateTime()); + + return lazyNettyServerPropertiesDO; + } +}