diff --git a/genti-api/src/main/java/com/gt/genti/user/service/UserSignUpEventPublisher.java b/genti-api/src/main/java/com/gt/genti/user/service/UserSignUpEventPublisher.java index 6999425e..351f7f2e 100644 --- a/genti-api/src/main/java/com/gt/genti/user/service/UserSignUpEventPublisher.java +++ b/genti-api/src/main/java/com/gt/genti/user/service/UserSignUpEventPublisher.java @@ -15,18 +15,14 @@ @RequiredArgsConstructor public class UserSignUpEventPublisher { - private final ApplicationEventPublisher eventPublisher; + private final ApplicationEventPublisher eventPublisher; - @Async - @Transactional(propagation = Propagation.REQUIRES_NEW) - public void publishSignUpEvent(User user) { - eventPublisher.publishEvent(SignUpEvent.of( - user.getId(), - user.getUsername(), - user.getEmail() == null ? "" : user.getEmail(), - user.getLastLoginOauthPlatform().toString(), - user.getCreatedAt() - )); - } + @Async + @Transactional(propagation = Propagation.REQUIRES_NEW) + public void publishSignUpEvent(User user) { + eventPublisher.publishEvent( + SignUpEvent.of(user.getId(), user.getUsername(), user.getEmail() == null ? "" : user.getEmail(), + user.getSex().getResponse(), user.getLastLoginOauthPlatform().toString(), user.getCreatedAt())); + } } diff --git a/genti-external/src/main/java/com/gt/genti/discord/DiscordAppender.java b/genti-external/src/main/java/com/gt/genti/discord/DiscordAppender.java index d8ee2d2a..f76ea9ce 100644 --- a/genti-external/src/main/java/com/gt/genti/discord/DiscordAppender.java +++ b/genti-external/src/main/java/com/gt/genti/discord/DiscordAppender.java @@ -135,7 +135,7 @@ protected void append(ILoggingEvent eventObject) { } } - public void signInAppend(Long totalUserCount, String name, String email, String socialPlatform, + public void signInAppend(Long totalUserCount, String name, String email, String sex, String socialPlatform, LocalDateTime createdAt) { if ("local".equals(profile)) { return; @@ -149,6 +149,7 @@ public void signInAppend(Long totalUserCount, String name, String email, String .build() .addField(Field.builder().name("[이름]").value(name).inline(false).build()) .addField(Field.builder().name("[이메일]").value(email).inline(false).build()) + .addField(Field.builder().name("[성별]").value(email).inline(false).build()) .addField(Field.builder().name("[소셜 플랫폼]").value(socialPlatform).inline(false).build()) .addField(Field.builder().name("[가입 일시]").value(String.valueOf(createdAt)).inline(false).build())); diff --git a/genti-external/src/main/java/com/gt/genti/discord/event/SignUpEvent.java b/genti-external/src/main/java/com/gt/genti/discord/event/SignUpEvent.java index b110e607..6eb7c3a3 100644 --- a/genti-external/src/main/java/com/gt/genti/discord/event/SignUpEvent.java +++ b/genti-external/src/main/java/com/gt/genti/discord/event/SignUpEvent.java @@ -2,12 +2,12 @@ import java.time.LocalDateTime; -public record SignUpEvent(Long totalUserCount, String name, String email, String socialPlatform, +public record SignUpEvent(Long totalUserCount, String name, String email, String sex, String socialPlatform, LocalDateTime createdAt) { - public static SignUpEvent of(Long totalUserCount, String name, String email, String socialPlatform, + public static SignUpEvent of(Long totalUserCount, String name, String email, String sex, String socialPlatform, LocalDateTime createdAt) { - return new SignUpEvent(totalUserCount, name, email, socialPlatform, createdAt); + return new SignUpEvent(totalUserCount, name, email, sex, socialPlatform, createdAt); } } diff --git a/genti-external/src/main/java/com/gt/genti/discord/event/SignUpEventListener.java b/genti-external/src/main/java/com/gt/genti/discord/event/SignUpEventListener.java index 346b604b..0fb316d8 100644 --- a/genti-external/src/main/java/com/gt/genti/discord/event/SignUpEventListener.java +++ b/genti-external/src/main/java/com/gt/genti/discord/event/SignUpEventListener.java @@ -21,6 +21,7 @@ public void handleSignUpEvent(SignUpEvent event) { event.totalUserCount(), event.name(), event.email(), + event.sex(), event.socialPlatform(), event.createdAt()); }