diff --git a/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/controller/MyBoardController.kt b/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/controller/MyBoardController.kt index 2a5150d..10522e3 100644 --- a/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/controller/MyBoardController.kt +++ b/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/controller/MyBoardController.kt @@ -22,7 +22,7 @@ class MyBoardController(private val myBoardService : MyBoardService) { @RequestParam size : Int ) : ApplicationResponse> { 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)) } diff --git a/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/service/MyBoardService.kt b/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/service/MyBoardService.kt index 9f2dfde..aa2a357 100644 --- a/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/service/MyBoardService.kt +++ b/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/service/MyBoardService.kt @@ -27,7 +27,7 @@ class MyBoardService(private val boardJooqRepository: BoardJooqRepository) { } fun getMyBoards(userId: Long, page: Int, size: Int): PageDto { - 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