From 2839c775b32c04c3f4895cf5d39cf9ea14da2e04 Mon Sep 17 00:00:00 2001 From: JanooGwan Date: Mon, 16 Mar 2026 22:35:17 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20channelId=20=ED=95=84=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= 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) {