Skip to content

Commit

Permalink
YEL-214 [feat] 추천인코드 가입시 열람권 지급 푸시알림 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonjeongs committed Feb 28, 2024
1 parent 4b4a5c4 commit 01f65ca
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void recommendUser(String recommendYelloId, String userYelloId) {
ZonedDateTime.now(GlobalZoneId).format(ISO_OFFSET_DATE_TIME),
recommendedUser
));
notificationService.sendRecommendSignupNotification(recommendedUser);
}

notificationService.sendRecommendNotification(user, recommendedUser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static NotificationMessage toUserAndFriendRecommendSignupNotificationCont
return NotificationMessage.builder()
.title(MessageFormat.format("{0}님이 나를 추천인으로 가입해 열람권이 지급됐어요!", user.getName()))
.message("지금이다! 날 짝사랑 하는 사람 보러가기")
.type(NotificationType.OPEN_VOTE)
.type(NotificationType.RECOMMEND)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,16 @@ public void sendOpenVoteNotification(User user) {
fcmManager.send(message);
}
}

@Override
public void sendRecommendSignupNotification(User recommendUser) {
NotificationMessage notificationMessage =
NotificationMessage.toUserAndFriendRecommendSignupNotificationContent(recommendUser);

if (recommendUser.getDeviceToken() != null && !Objects.equals(recommendUser.getDeviceToken(), "")) {
final Message message =
fcmManager.createMessage(recommendUser.getDeviceToken(), notificationMessage);
fcmManager.send(message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ public interface NotificationService {
void sendLunchEventNotification(User userList);

void sendOpenVoteNotification(User user);

void sendRecommendSignupNotification(User user);
}

0 comments on commit 01f65ca

Please sign in to comment.