From 45951f4e386b34a19db2f47c9dc475f3ea48c3e5 Mon Sep 17 00:00:00 2001 From: seongjae6751 Date: Mon, 25 Nov 2024 22:26:13 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=ED=82=A4=EC=9B=8C=EB=93=9C=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20schemeUri=EC=97=90=20keyword=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../keyword/model/ArticleKeywordEventListener.java | 1 + .../notification/model/NotificationFactory.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/in/koreatech/koin/domain/community/keyword/model/ArticleKeywordEventListener.java b/src/main/java/in/koreatech/koin/domain/community/keyword/model/ArticleKeywordEventListener.java index 9196b1d7a..45fff04f4 100644 --- a/src/main/java/in/koreatech/koin/domain/community/keyword/model/ArticleKeywordEventListener.java +++ b/src/main/java/in/koreatech/koin/domain/community/keyword/model/ArticleKeywordEventListener.java @@ -80,6 +80,7 @@ private Notification createAndRecordNotification( Notification notification = notificationFactory.generateKeywordNotification( KEYWORD, event.articleId(), + keyword, articleTitle, description, subscribe.getUser() diff --git a/src/main/java/in/koreatech/koin/global/domain/notification/model/NotificationFactory.java b/src/main/java/in/koreatech/koin/global/domain/notification/model/NotificationFactory.java index 990f17c93..3e9e8574c 100644 --- a/src/main/java/in/koreatech/koin/global/domain/notification/model/NotificationFactory.java +++ b/src/main/java/in/koreatech/koin/global/domain/notification/model/NotificationFactory.java @@ -83,13 +83,14 @@ public Notification generateDiningImageUploadNotification( public Notification generateKeywordNotification( MobileAppPath path, Integer eventKeywordId, + String keyword, String title, String description, User target ) { return new Notification( path, - generateSchemeUri(path, eventKeywordId), + generateKeywordSchemeUri(path, eventKeywordId, keyword), title, description, null, @@ -110,4 +111,14 @@ private String getPostposition(String place, String firstPost, String secondPost String result = (lastChar - 0xAC00) % 28 > 0 ? firstPost : secondPost; return place + result; } + + private String generateKeywordSchemeUri(MobileAppPath path, Integer eventId, String keyword) { + if (eventId == null) { + return path.getPath(); + } + if (keyword == null) { + return path.getPath(); + } + return String.format("%s?id=%d&keyword=%s", path.getPath(), eventId, keyword); + } } From 74328b4cdb7caf0047b40ede6dd887bf9a5b0fc0 Mon Sep 17 00:00:00 2001 From: seongjae6751 Date: Mon, 25 Nov 2024 23:03:32 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/notification/model/NotificationFactory.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/in/koreatech/koin/global/domain/notification/model/NotificationFactory.java b/src/main/java/in/koreatech/koin/global/domain/notification/model/NotificationFactory.java index 3e9e8574c..636d95c82 100644 --- a/src/main/java/in/koreatech/koin/global/domain/notification/model/NotificationFactory.java +++ b/src/main/java/in/koreatech/koin/global/domain/notification/model/NotificationFactory.java @@ -113,11 +113,8 @@ private String getPostposition(String place, String firstPost, String secondPost } private String generateKeywordSchemeUri(MobileAppPath path, Integer eventId, String keyword) { - if (eventId == null) { - return path.getPath(); - } if (keyword == null) { - return path.getPath(); + return generateSchemeUri(path, eventId); } return String.format("%s?id=%d&keyword=%s", path.getPath(), eventId, keyword); }