From 8c84b0b7dd9455081b90fe5eced6211fc7c2861d Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 14:12:04 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Pub=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/example/adapter/ArtistCreateAdapter.java | 6 +++--- .../request/ArtistCreateInfraRequest.java | 16 ---------------- .../ArtistGenreDomainInfraMessage.java} | 8 ++++---- .../ArtistWithGenreCreateInfraMessage.java | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java rename app/infrastructure/message-queue/src/main/java/org/example/{adapter/request/ArtistDomainInfraRequest.java => message/ArtistGenreDomainInfraMessage.java} (67%) create mode 100644 app/infrastructure/message-queue/src/main/java/org/example/message/ArtistWithGenreCreateInfraMessage.java diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java b/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java index 96d955dd..2b1d727c 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java @@ -2,7 +2,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.example.adapter.request.ArtistCreateInfraRequest; +import org.example.message.ArtistWithGenreCreateInfraMessage; import org.example.port.ArtistCreatePort; import org.example.port.dto.request.ArtistCreatePortRequest; import org.springframework.data.redis.core.RedisTemplate; @@ -17,10 +17,10 @@ public class ArtistCreateAdapter implements ArtistCreatePort { @Override public void createArtist(String topic, ArtistCreatePortRequest request) { - var infraMessage = ArtistCreateInfraRequest.from(request); + var infraMessage = ArtistWithGenreCreateInfraMessage.from(request); template.convertAndSend(topic, infraMessage); log.info("Message published successfully to topic: {}", topic); - log.info("Message Contents ( ArtistCreateInfraRequest : {})", infraMessage); + log.info("Message Contents ( ArtistWithGenreCreateInfraMessage : {})", infraMessage); } } diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java b/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java deleted file mode 100644 index c673726c..00000000 --- a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.example.adapter.request; - -import java.util.List; -import org.example.port.dto.request.ArtistCreatePortRequest; - -public record ArtistCreateInfraRequest( - List request -) { - - public static ArtistCreateInfraRequest from(ArtistCreatePortRequest request) { - return new ArtistCreateInfraRequest( - request.artists().stream().map(ArtistDomainInfraRequest::from).toList() - ); - } - -} diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistGenreDomainInfraMessage.java similarity index 67% rename from app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java rename to app/infrastructure/message-queue/src/main/java/org/example/message/ArtistGenreDomainInfraMessage.java index b59d9bf5..1ab8b54f 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistGenreDomainInfraMessage.java @@ -1,4 +1,4 @@ -package org.example.adapter.request; +package org.example.message; import java.util.List; import java.util.UUID; @@ -6,7 +6,7 @@ import org.example.port.dto.request.ArtistDomainPortRequest; @Builder -public record ArtistDomainInfraRequest( +public record ArtistGenreDomainInfraMessage( UUID id, String name, @@ -15,8 +15,8 @@ public record ArtistDomainInfraRequest( List genres ) { - public static ArtistDomainInfraRequest from(ArtistDomainPortRequest request) { - return ArtistDomainInfraRequest.builder() + public static ArtistGenreDomainInfraMessage from(ArtistDomainPortRequest request) { + return ArtistGenreDomainInfraMessage.builder() .id(request.id()) .name(request.name()) .image(request.image()) diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistWithGenreCreateInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistWithGenreCreateInfraMessage.java new file mode 100644 index 00000000..f6e399d4 --- /dev/null +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistWithGenreCreateInfraMessage.java @@ -0,0 +1,16 @@ +package org.example.message; + +import java.util.List; +import org.example.port.dto.request.ArtistCreatePortRequest; + +public record ArtistWithGenreCreateInfraMessage( + List request +) { + + public static ArtistWithGenreCreateInfraMessage from(ArtistCreatePortRequest request) { + return new ArtistWithGenreCreateInfraMessage( + request.artists().stream().map(ArtistGenreDomainInfraMessage::from).toList() + ); + } + +}