Add user content endpoints

This commit is contained in:
Tim
2025-07-01 13:23:04 +08:00
parent 4f34d6926e
commit 0031b825e2
8 changed files with 155 additions and 0 deletions

View File

@@ -2,11 +2,14 @@ package com.openisle.repository;
import com.openisle.model.Comment;
import com.openisle.model.Post;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import com.openisle.model.User;
import java.util.List;
public interface CommentRepository extends JpaRepository<Comment, Long> {
List<Comment> findByPostAndParentIsNullOrderByCreatedAtAsc(Post post);
List<Comment> findByParentOrderByCreatedAtAsc(Comment parent);
List<Comment> findByAuthorOrderByCreatedAtDesc(User author, Pageable pageable);
}