Skip to content

Commit

Permalink
[Refactor] 메인 화면 가져오는 게시글 갯수 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed Jul 3, 2024
1 parent f0f6888 commit d819952
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public ResponseEntity<ResponseDto<List<PostListResponseDto>>> getPostForTop(@Req
return new ResponseEntity<>(new ResponseDto<>(postService.getTop(category),"인기 게시글 가져오기 성공"),HttpStatus.OK);
}

@Operation(summary = "메인 페이지 게시글 7개 가져오기",description = "좋아요가 1개 이상인 게시글 7개의 리스트가 3시간 간격으로 랜덤으로 바뀝니다")
@Operation(summary = "메인 페이지 게시글 7개 가져오기",description = "좋아요가 1개 이상인 게시글 9개의 리스트가 3시간 간격으로 랜덤으로 바뀝니다")
@ApiResponses({
@ApiResponse(responseCode = "200",description = "메인 페이지 게시글 7개 가져오기 성공",content = @Content(schema = @Schema(implementation = PostListResponseDto.class)))
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface PostRepository extends JpaRepository<Post,Long> {
@Query("SELECT p FROM Post p WHERE p.good >= 1 AND (:category IS NULL OR p.category = :category) ORDER BY p.good DESC ,p.id DESC LIMIT 12")
List<Post> findTop12(String category);

@Query("SELECT p FROM Post p WHERE p.good>= 1 ORDER BY RAND() LIMIT 7")
@Query("SELECT p FROM Post p WHERE p.good>= 1 ORDER BY RAND() LIMIT 9")
List<Post> findRandomTop();

@Lock(LockModeType.PESSIMISTIC_WRITE)
Expand Down

0 comments on commit d819952

Please sign in to comment.