Skip to content

Commit

Permalink
fix: 페이징 offset 계산 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dldmsql committed Nov 7, 2024
1 parent 9730829 commit 9226e58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
config:
activate:
on-profile: dev
on-profile: local
datasource:
url: ENC(pz7EEQu20leZT3uKvGuyvt7YhmLSOJ03yp09o3HSmvk8QqSORYES8Y0iqtjYt3An0uSXVGvd+PdNxXF4h1KXbLm6aMSl2K9gWh2XR5GbIpPAKasqkuha20MGAVckb9NRQC3s0IowzCMvt+jOv0Z1RrAnsfzJy08ZbWe41Slcz/VaQU1hSF6HVohMUrBPApDELlW558sM0jWPfi7NPYNGSlyB4f3bYa0WqjOIAAKPVb3ptvrQwmN7Wg==)
username: ENC(6B0VWBlhLIFr2ynq8c8jug==)
Expand Down Expand Up @@ -42,4 +42,4 @@ logging:
webhook-uri: ENC(yfeX3WHXQdxkVtasNl5WLv6M/YlN+dVFUurjxGIddstjjipt+KryWKvLu1wDmdGjpuEhUHyaABg4gFWRMk9gNlxSQEE/G1twbuvkOvT0pyFWycVVJ6ryU/v9pDBOS1PSKJY7L3NP66gOGnam6nOvf0Y+F45zZvXj8/sdtR6N798U6fGjFDxOLQ==)

level:
root: ERROR
root: INFO

0 comments on commit 9226e58

Please sign in to comment.