Skip to content

Commit

Permalink
fix: Pub 네이밍 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom committed Sep 26, 2024
1 parent d97f5ab commit 8c84b0b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.example.adapter.request;
package org.example.message;

import java.util.List;
import java.util.UUID;
import lombok.Builder;
import org.example.port.dto.request.ArtistDomainPortRequest;

@Builder
public record ArtistDomainInfraRequest(
public record ArtistGenreDomainInfraMessage(

UUID id,
String name,
Expand All @@ -15,8 +15,8 @@ public record ArtistDomainInfraRequest(
List<String> 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())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.example.message;

import java.util.List;
import org.example.port.dto.request.ArtistCreatePortRequest;

public record ArtistWithGenreCreateInfraMessage(
List<ArtistGenreDomainInfraMessage> request
) {

public static ArtistWithGenreCreateInfraMessage from(ArtistCreatePortRequest request) {
return new ArtistWithGenreCreateInfraMessage(
request.artists().stream().map(ArtistGenreDomainInfraMessage::from).toList()
);
}

}

0 comments on commit 8c84b0b

Please sign in to comment.