Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 200168c

Browse files
committed
Merge branch 'feature/board'
2 parents d4e74d9 + a51dce7 commit 200168c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/main/java/com/rest/api/repo/board/PostJpaRepo.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
import java.util.List;
88

99
public interface PostJpaRepo extends JpaRepository<Post, Long> {
10-
List<Post> findByBoard(Board board);
10+
List<Post> findByBoardOrderByPostIdDesc(Board board);
1111
}

‎src/main/java/com/rest/api/service/board/BoardService.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public Board findBoard(String boardName) {
4343
// 게시판 이름으로 게시글 리스트 조회.
4444
@Cacheable(value = CacheKey.POSTS, key = "#boardName", unless = "#result == null")
4545
public List<Post> findPosts(String boardName) {
46-
return postJpaRepo.findByBoard(findBoard(boardName));
46+
return postJpaRepo.findByBoardOrderByPostIdDesc(findBoard(boardName));
4747
}
4848

4949
// 게시글ID로 게시글 단건 조회. 없을경우 CResourceNotExistException 처리

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /