我有以下代码来存储评论库,并通过它们所归属的帖子的 ID 找到它们:
@RepositoryRestResource(path = "/comments")
public interface CommentsRestRepository extends MongoRepository<Comment, String> {
Page<Comment> findByPostID(@Param("postID") String postID, Pageable pageable);
}
使用 URLhttp://localhost:8080/comments/search/findByPostID?postID=55ff128577c8dc3d6b311da7
时,它可以工作。但是,如果我添加&page=1&size=5
页面/大小/排序或任何其他组合,它会完全忽略这些参数。为什么是这样?