Add post and comment deletion

This commit is contained in:
Tim
2025-07-11 17:24:48 +08:00
parent 216faeb496
commit f4af7a48c7
7 changed files with 139 additions and 3 deletions

View File

@@ -2,6 +2,8 @@ package com.openisle.repository;
import com.openisle.model.Notification;
import com.openisle.model.User;
import com.openisle.model.Post;
import com.openisle.model.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
@@ -11,4 +13,6 @@ public interface NotificationRepository extends JpaRepository<Notification, Long
List<Notification> findByUserOrderByCreatedAtDesc(User user);
List<Notification> findByUserAndReadOrderByCreatedAtDesc(User user, boolean read);
long countByUserAndRead(User user, boolean read);
List<Notification> findByPost(Post post);
List<Notification> findByComment(Comment comment);
}