Skip to content

Commit

Permalink
hotfix: 회원가입시 성별도 디스코드에 전송
Browse files Browse the repository at this point in the history
  • Loading branch information
BYEONGRYEOL committed Sep 15, 2024
1 parent 49490f0 commit 4a3fe6a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public void handleSignUpEvent(SignUpEvent event) {
event.totalUserCount(),
event.name(),
event.email(),
event.sex(),
event.socialPlatform(),
event.createdAt());
}
Expand Down

0 comments on commit 4a3fe6a

Please sign in to comment.