Expand post details with comments and reactions

This commit is contained in:
Tim
2025-06-30 20:43:48 +08:00
parent 25a9239cc7
commit eabae2eb5a
3 changed files with 94 additions and 0 deletions

View File

@@ -6,9 +6,12 @@ import com.openisle.model.Reaction;
import com.openisle.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface ReactionRepository extends JpaRepository<Reaction, Long> {
Optional<Reaction> findByUserAndPost(User user, Post post);
Optional<Reaction> findByUserAndComment(User user, Comment comment);
List<Reaction> findByPost(Post post);
List<Reaction> findByComment(Comment comment);
}