Skip to content

Commit 8d755ad

Browse files
authored
Merge pull request #43 from DDD-Community/feature/POLABO-130
fix: 페이징 offset 계산 수정
2 parents e5a59cd + 9226e58 commit 8d755ad

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/kotlin/com/ddd/sonnypolabobe/domain/board/my/service/MyBoardService.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ class MyBoardService(
5353
MyBoardV2Controller.Companion.Filter.OWNER -> {
5454
val data = this.boardJooqRepository.findAllByUserId(userId, page - 1, size)
5555
val totalCount = this.boardJooqRepository.selectTotalCountByUserId(userId)
56-
return PageDto(data, totalCount, page, size)
56+
return PageDto(data, totalCount, page, data.size)
5757
}
5858

5959
MyBoardV2Controller.Companion.Filter.PARTICIPANT -> {
6060
val data = this.boardJooqRepository.findAllByParticipant(userId, page - 1, size)
6161
val totalCount = this.boardJooqRepository.selectTotalCountByParticipant(userId)
62-
return PageDto(data, totalCount, page, size)
62+
return PageDto(data, totalCount, page, data.size)
6363
}
6464
}
6565
}

src/main/kotlin/com/ddd/sonnypolabobe/domain/board/repository/BoardJooqRepositoryImpl.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class BoardJooqRepositoryImpl(
154154
.where(jBoard.USER_ID.eq(userId).and(jBoard.YN.eq(1)).and(jBoard.ACTIVEYN.eq(1)))
155155
.orderBy(jBoard.CREATED_AT.desc())
156156
.limit(size)
157-
.offset(page)
157+
.offset(page * size)
158158
.fetch()
159159

160160
return data.map {

src/main/resources/application-local.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
spring:
22
config:
33
activate:
4-
on-profile: dev
4+
on-profile: local
55
datasource:
66
url: ENC(pz7EEQu20leZT3uKvGuyvt7YhmLSOJ03yp09o3HSmvk8QqSORYES8Y0iqtjYt3An0uSXVGvd+PdNxXF4h1KXbLm6aMSl2K9gWh2XR5GbIpPAKasqkuha20MGAVckb9NRQC3s0IowzCMvt+jOv0Z1RrAnsfzJy08ZbWe41Slcz/VaQU1hSF6HVohMUrBPApDELlW558sM0jWPfi7NPYNGSlyB4f3bYa0WqjOIAAKPVb3ptvrQwmN7Wg==)
77
username: ENC(6B0VWBlhLIFr2ynq8c8jug==)
@@ -42,4 +42,4 @@ logging:
4242
webhook-uri: ENC(yfeX3WHXQdxkVtasNl5WLv6M/YlN+dVFUurjxGIddstjjipt+KryWKvLu1wDmdGjpuEhUHyaABg4gFWRMk9gNlxSQEE/G1twbuvkOvT0pyFWycVVJ6ryU/v9pDBOS1PSKJY7L3NP66gOGnam6nOvf0Y+F45zZvXj8/sdtR6N798U6fGjFDxOLQ==)
4343

4444
level:
45-
root: ERROR
45+
root: INFO

0 commit comments

Comments
 (0)