From 9226e5806df2f24a5a21537619a7e6e76fce2012 Mon Sep 17 00:00:00 2001 From: dldmsql Date: Thu, 7 Nov 2024 21:39:20 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8E=98=EC=9D=B4=EC=A7=95=20offset=20?= =?UTF-8?q?=EA=B3=84=EC=82=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sonnypolabobe/domain/board/my/service/MyBoardService.kt | 4 ++-- .../domain/board/repository/BoardJooqRepositoryImpl.kt | 2 +- src/main/resources/application-local.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) 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 c08fc93..545bc58 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 @@ -53,13 +53,13 @@ class MyBoardService( MyBoardV2Controller.Companion.Filter.OWNER -> { val data = this.boardJooqRepository.findAllByUserId(userId, page - 1, size) val totalCount = this.boardJooqRepository.selectTotalCountByUserId(userId) - return PageDto(data, totalCount, page, size) + return PageDto(data, totalCount, page, data.size) } MyBoardV2Controller.Companion.Filter.PARTICIPANT -> { val data = this.boardJooqRepository.findAllByParticipant(userId, page - 1, size) val totalCount = this.boardJooqRepository.selectTotalCountByParticipant(userId) - return PageDto(data, totalCount, page, size) + return PageDto(data, totalCount, page, data.size) } } } diff --git a/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/repository/BoardJooqRepositoryImpl.kt b/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/repository/BoardJooqRepositoryImpl.kt index 7ec3a6c..f11702e 100644 --- a/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/repository/BoardJooqRepositoryImpl.kt +++ b/src/main/kotlin/com/ddd/sonnypolabobe/domain/board/repository/BoardJooqRepositoryImpl.kt @@ -154,7 +154,7 @@ class BoardJooqRepositoryImpl( .where(jBoard.USER_ID.eq(userId).and(jBoard.YN.eq(1)).and(jBoard.ACTIVEYN.eq(1))) .orderBy(jBoard.CREATED_AT.desc()) .limit(size) - .offset(page) + .offset(page * size) .fetch() return data.map { diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index fa6ecc0..5935ced 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -1,7 +1,7 @@ spring: config: activate: - on-profile: dev + on-profile: local datasource: url: ENC(pz7EEQu20leZT3uKvGuyvt7YhmLSOJ03yp09o3HSmvk8QqSORYES8Y0iqtjYt3An0uSXVGvd+PdNxXF4h1KXbLm6aMSl2K9gWh2XR5GbIpPAKasqkuha20MGAVckb9NRQC3s0IowzCMvt+jOv0Z1RrAnsfzJy08ZbWe41Slcz/VaQU1hSF6HVohMUrBPApDELlW558sM0jWPfi7NPYNGSlyB4f3bYa0WqjOIAAKPVb3ptvrQwmN7Wg==) username: ENC(6B0VWBlhLIFr2ynq8c8jug==) @@ -42,4 +42,4 @@ logging: webhook-uri: ENC(yfeX3WHXQdxkVtasNl5WLv6M/YlN+dVFUurjxGIddstjjipt+KryWKvLu1wDmdGjpuEhUHyaABg4gFWRMk9gNlxSQEE/G1twbuvkOvT0pyFWycVVJ6ryU/v9pDBOS1PSKJY7L3NP66gOGnam6nOvf0Y+F45zZvXj8/sdtR6N798U6fGjFDxOLQ==) level: - root: ERROR + root: INFO