From acca3ad55ba972d7113c74d31af46f8e7c5d627c Mon Sep 17 00:00:00 2001 From: JanooGwan <103417427+JanooGwan@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:40:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20channelId=20=ED=95=84=EB=93=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20(#394)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/notification/service/NotificationService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/gg/agit/konect/domain/notification/service/NotificationService.java b/src/main/java/gg/agit/konect/domain/notification/service/NotificationService.java index 6eca0f39..62200ad3 100644 --- a/src/main/java/gg/agit/konect/domain/notification/service/NotificationService.java +++ b/src/main/java/gg/agit/konect/domain/notification/service/NotificationService.java @@ -38,6 +38,7 @@ public class NotificationService { private static final String EXPO_PUSH_URL = "https://exp.host/--/api/v2/push/send"; private static final Pattern EXPO_PUSH_TOKEN_PATTERN = Pattern.compile("^(ExponentPushToken|ExpoPushToken)\\[[^\\]]+\\]$"); + private static final String DEFAULT_NOTIFICATION_CHANNEL_ID = "default_notifications"; private static final int CHAT_MESSAGE_PREVIEW_MAX_LENGTH = 30; private static final String CHAT_MESSAGE_PREVIEW_SUFFIX = "..."; @@ -118,7 +119,7 @@ public void sendChatNotification(Integer receiverId, Integer roomId, String send data.put("path", "chats/" + roomId); List messages = tokens.stream() - .map(token -> new ExpoPushMessage(token, senderName, truncatedBody, data)) + .map(token -> new ExpoPushMessage(token, senderName, truncatedBody, data, DEFAULT_NOTIFICATION_CHANNEL_ID)) .toList(); HttpHeaders headers = new HttpHeaders(); @@ -238,7 +239,7 @@ public void sendGroupChatNotification( } List messages = tokens.stream() - .map(token -> new ExpoPushMessage(token, clubName, previewBody, data)) + .map(token -> new ExpoPushMessage(token, clubName, previewBody, data, DEFAULT_NOTIFICATION_CHANNEL_ID)) .toList(); HttpHeaders headers = new HttpHeaders(); @@ -344,7 +345,7 @@ private void sendNotification(Integer receiverId, String title, String body, Str Map data = buildData(null, path); List messages = tokens.stream() - .map(token -> new ExpoPushMessage(token, title, body, data)) + .map(token -> new ExpoPushMessage(token, title, body, data, DEFAULT_NOTIFICATION_CHANNEL_ID)) .toList(); HttpHeaders headers = new HttpHeaders(); @@ -421,7 +422,7 @@ private String buildPreview(String messageContent) { return messageContent.substring(0, endIndex) + CHAT_MESSAGE_PREVIEW_SUFFIX; } - private record ExpoPushMessage(String to, String title, String body, Map data) { + private record ExpoPushMessage(String to, String title, String body, Map data, String channelId) { } private record ExpoPushResponse(List data) { From acf72c8c9ea2ce92a820713bf8401bf86d325f84 Mon Sep 17 00:00:00 2001 From: JanooGwan <103417427+JanooGwan@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:56:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20checkstyle=20=EC=9C=84=EB=B0=98=20?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/notification/service/NotificationService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/gg/agit/konect/domain/notification/service/NotificationService.java b/src/main/java/gg/agit/konect/domain/notification/service/NotificationService.java index 62200ad3..27c11e52 100644 --- a/src/main/java/gg/agit/konect/domain/notification/service/NotificationService.java +++ b/src/main/java/gg/agit/konect/domain/notification/service/NotificationService.java @@ -119,7 +119,8 @@ public void sendChatNotification(Integer receiverId, Integer roomId, String send data.put("path", "chats/" + roomId); List messages = tokens.stream() - .map(token -> new ExpoPushMessage(token, senderName, truncatedBody, data, DEFAULT_NOTIFICATION_CHANNEL_ID)) + .map(token -> new ExpoPushMessage( + token, senderName, truncatedBody, data, DEFAULT_NOTIFICATION_CHANNEL_ID)) .toList(); HttpHeaders headers = new HttpHeaders(); @@ -239,7 +240,8 @@ public void sendGroupChatNotification( } List messages = tokens.stream() - .map(token -> new ExpoPushMessage(token, clubName, previewBody, data, DEFAULT_NOTIFICATION_CHANNEL_ID)) + .map(token -> new ExpoPushMessage( + token, clubName, previewBody, data, DEFAULT_NOTIFICATION_CHANNEL_ID)) .toList(); HttpHeaders headers = new HttpHeaders();