diff --git a/src/main/java/com/ko/footballupdater/repositories/PostRepository.java b/src/main/java/com/ko/footballupdater/repositories/PostRepository.java index 0f7f742..bf229d4 100644 --- a/src/main/java/com/ko/footballupdater/repositories/PostRepository.java +++ b/src/main/java/com/ko/footballupdater/repositories/PostRepository.java @@ -17,6 +17,8 @@ public interface PostRepository extends CrudRepository { List findAllByOrderByDateGeneratedDesc(Pageable pageable); + List findAllByOrderByDateGeneratedAsc(Pageable pageable); + List findByPostedStatus(boolean postedStatus); List findByPostedStatusOrderByDateGeneratedDesc(boolean postedStatus, Pageable pageable); @@ -24,6 +26,4 @@ public interface PostRepository extends CrudRepository { @Modifying @Query("update Post p set p.postedStatus = :postedStatus where p.id = :id") void updatePostSetPostedStatusForId(@Param("postedStatus") boolean postedStatus, @Param("id") int id); - - -} \ No newline at end of file +} diff --git a/src/main/java/com/ko/footballupdater/services/PerformanceAnalysisService.java b/src/main/java/com/ko/footballupdater/services/PerformanceAnalysisService.java index 3fc61ca..905f74a 100644 --- a/src/main/java/com/ko/footballupdater/services/PerformanceAnalysisService.java +++ b/src/main/java/com/ko/footballupdater/services/PerformanceAnalysisService.java @@ -21,7 +21,7 @@ public class PerformanceAnalysisService { private PostRepository postRepository; public Map> checkMatchPerformances() { - List recentPosts = postRepository.findAllByOrderByDateGeneratedDesc(PageRequest.of(1, 10)); + List recentPosts = postRepository.findAllByOrderByDateGeneratedDesc(PageRequest.of(0, 20)); Map> postsWithHighlights = new HashMap<>(); // Check stats in each recent post for highlights @@ -61,5 +61,4 @@ public Map checkHighlightsInMatch(Post post) { } return highlights; } - }