Skip to content

Commit

Permalink
[IDLE-492] 동일 유저가 여러 개의 디바이스를 사용 시, 알림이 중복해서 누적되는 현상
Browse files Browse the repository at this point in the history
  • Loading branch information
wonjunYou committed Nov 4, 2024
1 parent 32e11d3 commit 783e5b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ class CarerApplyFacadeService(
centerManagers?.forEach { centerManager ->
val deviceTokens = deviceTokenService.findAllByUserId(centerManager.id)

deviceTokens?.forEach { deviceToken ->
val notificationInfo = CarerApplyNotificationInfo(
title = "${carer.name} 님이 공고에 지원하였습니다.",
body = createBodyMessage(jobPosting),
receiverId = centerManager.id,
notificationType = NotificationType.APPLICANT,
imageUrl = carer.profileImageUrl,
notificationDetails = mapOf(
"jobPostingId" to jobPostingId,
)
val notificationInfo = CarerApplyNotificationInfo(
title = "${carer.name} 님이 공고에 지원하였습니다.",
body = createBodyMessage(jobPosting),
receiverId = centerManager.id,
notificationType = NotificationType.APPLICANT,
imageUrl = carer.profileImageUrl,
notificationDetails = mapOf(
"jobPostingId" to jobPostingId,
)
)

val notification = notificationService.create(notificationInfo)
val notification = notificationService.create(notificationInfo)

deviceTokens?.forEach { deviceToken ->
ApplyEvent.createApplyEvent(
deviceToken = deviceToken,
notificationId = notification.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- V4__alter_table_notification_add_column_device_token.sql

-- Add secondary index on deviceToken and userId columns
CREATE INDEX idx_user_id ON notification(userId);

0 comments on commit 783e5b2

Please sign in to comment.