feat: detailed reaction notifications

This commit is contained in:
Tim
2025-07-09 19:28:18 +08:00
parent 648a9d4a5c
commit 4a23bf5221
6 changed files with 72 additions and 3 deletions

View File

@@ -16,12 +16,19 @@ public class NotificationService {
private final UserRepository userRepository;
public Notification createNotification(User user, NotificationType type, Post post, Comment comment, Boolean approved) {
return createNotification(user, type, post, comment, approved, null, null);
}
public Notification createNotification(User user, NotificationType type, Post post, Comment comment, Boolean approved,
User fromUser, ReactionType reactionType) {
Notification n = new Notification();
n.setUser(user);
n.setType(type);
n.setPost(post);
n.setComment(comment);
n.setApproved(approved);
n.setFromUser(fromUser);
n.setReactionType(reactionType);
return notificationRepository.save(n);
}