-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from Genti2024/fix/gradle-test-fail-0724
Ref: #70 Github Actions CI/CD 파이프라인에서 Test 제거
- Loading branch information
Showing
10 changed files
with
77 additions
and
11 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
28 changes: 28 additions & 0 deletions
28
genti-api/src/main/java/com/gt/genti/picturegeneraterequest/service/MatchEventPublisher.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,28 @@ | ||
package com.gt.genti.picturegeneraterequest.service; | ||
|
||
import org.springframework.context.ApplicationEventPublisher; | ||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Propagation; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.gt.genti.discord.event.MatchEvent; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class MatchEventPublisher { | ||
|
||
private final ApplicationEventPublisher eventPublisher; | ||
|
||
@Async | ||
@Transactional(propagation = Propagation.REQUIRES_NEW) | ||
public void publishSignUpEvent(GentiMatchResult gentiMatchResult) { | ||
eventPublisher.publishEvent(MatchEvent.of( | ||
gentiMatchResult.getSummary(), | ||
gentiMatchResult.getMatchResultList() | ||
)); | ||
} | ||
|
||
} |
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
10 changes: 10 additions & 0 deletions
10
genti-external/src/main/java/com/gt/genti/discord/event/MatchEvent.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,10 @@ | ||
package com.gt.genti.discord.event; | ||
|
||
import java.util.List; | ||
|
||
public record MatchEvent(String summary, List<String> matchResultList) { | ||
public static MatchEvent of(String summary, List<String> matchResultList) { | ||
return new MatchEvent(summary, matchResultList); | ||
} | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
genti-external/src/main/java/com/gt/genti/discord/event/MatchEventListener.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,26 @@ | ||
package com.gt.genti.discord.event; | ||
|
||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.context.event.EventListener; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.gt.genti.discord.DiscordAppender; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Component | ||
@Profile({"local", "deploy"}) | ||
@RequiredArgsConstructor | ||
public class MatchEventListener { | ||
|
||
private final DiscordAppender discordAppender; | ||
|
||
@EventListener | ||
public void handleMatchEvent(MatchEvent event) { | ||
discordAppender.matchResultAppend( | ||
event.summary(), | ||
event.matchResultList() | ||
); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...ava/com/gt/genti/discord/SignUpEvent.java → ...m/gt/genti/discord/event/SignUpEvent.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,4 +1,4 @@ | ||
package com.gt.genti.discord; | ||
package com.gt.genti.discord.event; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
|
4 changes: 3 additions & 1 deletion
4
...gt/genti/discord/SignUpEventListener.java → ...ti/discord/event/SignUpEventListener.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