From 783e5b24031b97c67d15c45eafc913517a84ab60 Mon Sep 17 00:00:00 2001 From: wonjunYou Date: Mon, 4 Nov 2024 13:56:56 +0900 Subject: [PATCH] =?UTF-8?q?[IDLE-492]=20=EB=8F=99=EC=9D=BC=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=EA=B0=80=20=EC=97=AC=EB=9F=AC=20=EA=B0=9C=EC=9D=98=20?= =?UTF-8?q?=EB=94=94=EB=B0=94=EC=9D=B4=EC=8A=A4=EB=A5=BC=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=20=EC=8B=9C,=20=EC=95=8C=EB=A6=BC=EC=9D=B4=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=ED=95=B4=EC=84=9C=20=EB=88=84=EC=A0=81?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applys/facade/CarerApplyFacadeService.kt | 22 +++++++++---------- ...e_notification_add_column_device_token.sql | 4 ++++ 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 idle-domain/src/main/resources/db/migration/V4__alter_table_notification_add_column_device_token.sql diff --git a/idle-application/src/main/kotlin/com/swm/idle/application/applys/facade/CarerApplyFacadeService.kt b/idle-application/src/main/kotlin/com/swm/idle/application/applys/facade/CarerApplyFacadeService.kt index fc2b120a..f3ab6063 100644 --- a/idle-application/src/main/kotlin/com/swm/idle/application/applys/facade/CarerApplyFacadeService.kt +++ b/idle-application/src/main/kotlin/com/swm/idle/application/applys/facade/CarerApplyFacadeService.kt @@ -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, diff --git a/idle-domain/src/main/resources/db/migration/V4__alter_table_notification_add_column_device_token.sql b/idle-domain/src/main/resources/db/migration/V4__alter_table_notification_add_column_device_token.sql new file mode 100644 index 00000000..54430411 --- /dev/null +++ b/idle-domain/src/main/resources/db/migration/V4__alter_table_notification_add_column_device_token.sql @@ -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);