-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a19e6e
commit 94d13db
Showing
14 changed files
with
128 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
app/api/show-api/src/main/java/com/example/publish/message/ArtistServiceMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.example.publish.message; | ||
|
||
import java.util.UUID; | ||
import lombok.Builder; | ||
import org.example.entity.ArtistSubscription; | ||
import org.example.entity.artist.Artist; | ||
|
||
@Builder | ||
public record ArtistServiceMessage( | ||
UUID id, | ||
String name | ||
) { | ||
|
||
public static ArtistServiceMessage from(Artist artist) { | ||
return ArtistServiceMessage.builder() | ||
.id(artist.getId()) | ||
.name(artist.getEnglishName()) | ||
.build(); | ||
} | ||
|
||
public static ArtistServiceMessage toUnsubscribe(ArtistSubscription artistSubscription) { | ||
return ArtistServiceMessage.builder() | ||
.id(artistSubscription.getArtistId()) | ||
.name("empty") | ||
.build(); | ||
} | ||
} |
7 changes: 3 additions & 4 deletions
7
.../show-api/src/main/java/com/example/publish/message/ArtistSubscriptionServiceMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
package com.example.publish.message; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record ArtistSubscriptionServiceMessage( | ||
String userFcmToken, | ||
List<UUID> artistIds | ||
List<ArtistServiceMessage> artists | ||
) { | ||
|
||
public static ArtistSubscriptionServiceMessage from( | ||
String userFcmToken, | ||
List<UUID> artistIds | ||
List<ArtistServiceMessage> artists | ||
) { | ||
return ArtistSubscriptionServiceMessage.builder() | ||
.userFcmToken(userFcmToken) | ||
.artistIds(artistIds) | ||
.artists(artists) | ||
.build(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
app/api/show-api/src/main/java/com/example/publish/message/GenreServiceMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.example.publish.message; | ||
|
||
import java.util.UUID; | ||
import lombok.Builder; | ||
import org.example.entity.GenreSubscription; | ||
import org.example.entity.genre.Genre; | ||
|
||
@Builder | ||
public record GenreServiceMessage( | ||
UUID id, | ||
String name | ||
) { | ||
|
||
public static GenreServiceMessage from(Genre genre) { | ||
return GenreServiceMessage.builder() | ||
.id(genre.getId()) | ||
.name(genre.getName()) | ||
.build(); | ||
} | ||
|
||
public static GenreServiceMessage toUnsubscribe(GenreSubscription genreSubscription) { | ||
return GenreServiceMessage.builder() | ||
.id(genreSubscription.getGenreId()) | ||
.name("empty") | ||
.build(); | ||
} | ||
} |
7 changes: 3 additions & 4 deletions
7
...i/show-api/src/main/java/com/example/publish/message/GenreSubscriptionServiceMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
package com.example.publish.message; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record GenreSubscriptionServiceMessage( | ||
String userFcmToken, | ||
List<UUID> genreIds | ||
List<GenreServiceMessage> genres | ||
) { | ||
|
||
public static GenreSubscriptionServiceMessage from( | ||
String userFcmToken, | ||
List<UUID> genreIds | ||
List<GenreServiceMessage> genres | ||
) { | ||
return GenreSubscriptionServiceMessage.builder() | ||
.userFcmToken(userFcmToken) | ||
.genreIds(genreIds) | ||
.genres(genres) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/infrastructure/message-queue/src/main/java/org/example/message/ArtistInfraMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.example.message; | ||
|
||
import com.example.publish.message.ArtistServiceMessage; | ||
import java.util.UUID; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record ArtistInfraMessage( | ||
UUID artistId, | ||
String artistName | ||
) { | ||
|
||
public static ArtistInfraMessage from(ArtistServiceMessage message) { | ||
return ArtistInfraMessage.builder() | ||
.artistId(message.id()) | ||
.artistName(message.name()) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/infrastructure/message-queue/src/main/java/org/example/message/GenreInfraMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.example.message; | ||
|
||
import com.example.publish.message.GenreServiceMessage; | ||
import java.util.UUID; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record GenreInfraMessage( | ||
UUID genreId, | ||
String genreName | ||
) { | ||
|
||
public static GenreInfraMessage from(GenreServiceMessage message) { | ||
return GenreInfraMessage.builder() | ||
.genreId(message.id()) | ||
.genreName(message.name()) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters