File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
pro/src/main/java/com/example/pro/board/service Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -46,19 +46,18 @@ public Board findBoard(Long boardId) {
46
46
}
47
47
48
48
public BoardCountResponseDto findAllBoards () {
49
+ long totalCount = boardRepository .count ();
49
50
List <Board > boards = boardRepository .findAll ();
50
51
51
52
// 엔티티를 Dto로 변환하는 로직
52
53
List <BoardListResponseDto > responses = boards .stream ()
53
54
.map (BoardListResponseDto ::toBoardListDto )
54
55
.collect (Collectors .toList ());
55
- long count = boardRepository .count ();
56
- return new BoardCountResponseDto (responses , count );
56
+ return new BoardCountResponseDto (responses , totalCount );
57
57
}
58
58
59
59
public List <Board > searchTitle (String title ) {
60
60
return boardRepository .findByTitle (title );
61
-
62
61
}
63
62
64
63
@ Transactional
You can’t perform that action at this time.
0 commit comments