From 26ed082f9365f473d0e586af62b88996ed0c1a19 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 5 Aug 2025 23:54:40 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"revert:=20=E9=80=9A=E7=9F=A5=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=BC=82=E6=AD=A5=EF=BC=8C=E5=B9=B6=E4=B8=94=E9=87=87?= =?UTF-8?q?=E7=94=A8=E4=BA=8B=E5=8A=A1=EF=BC=8C=E7=9C=8B=E7=9C=8B=E8=83=BD?= =?UTF-8?q?=E5=90=A6=E8=A7=A3=E5=86=B3=20400"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4e0dda3a24327c9a30780154d2ca0a6bcc095edf. --- .../java/com/openisle/service/NotificationService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/com/openisle/service/NotificationService.java b/backend/src/main/java/com/openisle/service/NotificationService.java index 628c36a51..9ad4d9cdd 100644 --- a/backend/src/main/java/com/openisle/service/NotificationService.java +++ b/backend/src/main/java/com/openisle/service/NotificationService.java @@ -51,7 +51,10 @@ public class NotificationService { pushNotificationService.sendNotification(user, buildPayload(body, url)); } - @Transactional + public Notification createNotification(User user, NotificationType type, Post post, Comment comment, Boolean approved) { + return createNotification(user, type, post, comment, approved, null, null, null); + } + public Notification createNotification(User user, NotificationType type, Post post, Comment comment, Boolean approved, User fromUser, ReactionType reactionType, String content) { Notification n = new Notification(); @@ -68,7 +71,7 @@ public class NotificationService { } n = notificationRepository.save(n); -// notificationExecutor.execute(() -> { + notificationExecutor.execute(() -> { if (type == NotificationType.COMMENT_REPLY && user.getEmail() != null && post != null && comment != null) { String url = String.format("%s/posts/%d#comment-%d", websiteUrl, post.getId(), comment.getId()); emailSender.sendEmail(user.getEmail(), "有人回复了你", url); @@ -92,7 +95,7 @@ public class NotificationService { // } // } } -// }); + }); return n; }