Skip to content

Commit

Permalink
Merge pull request #25 from DDD-Community/feature/POLABO-108
Browse files Browse the repository at this point in the history
fix(POLABO-108): 페이지네이션 정책 통일화 작업 2차
  • Loading branch information
dldmsql authored Aug 16, 2024
2 parents f17af9c + d4e44d0 commit ab442d5
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 @@ -22,7 +22,7 @@ class MyBoardController(private val myBoardService : MyBoardService) {
@RequestParam size : Int
) : ApplicationResponse<PageDto<MyBoardDto.Companion.PageListRes>> {
val user = SecurityContextHolder.getContext().authentication.principal as UserDto.Companion.Res
return ApplicationResponse.ok(this.myBoardService.getMyBoards(user.id, page-1, size))
return ApplicationResponse.ok(this.myBoardService.getMyBoards(user.id, page, size))
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MyBoardService(private val boardJooqRepository: BoardJooqRepository) {
}

fun getMyBoards(userId: Long, page: Int, size: Int): PageDto<MyBoardDto.Companion.PageListRes> {
val data = this.boardJooqRepository.findAllByUserId(userId, page, size)
val data = this.boardJooqRepository.findAllByUserId(userId, page-1, size)
val totalCount = this.boardJooqRepository.selectTotalCountByUserId(userId)
val totalPage = totalCount.toInt() / size + 1

Expand Down

0 comments on commit ab442d5

Please sign in to comment.