-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[๐ Feature] ํ์ ๋ผ์ธ์ฉ ๋ชฉํ ์กฐํ API ๊ฐ๋ฐ - Pagination ๋ฐฉ์ offset ๊ธฐ๋ฐ์ผ๋ก ๋ณ๊ฒฝ (#243)
* delete: ์ ์ ์ ๋ณด๋ฅผ ํ์ฉํ ํ์๋ผ์ธ ์กฐํ API ์ญ์ * refactor: PaginationResult.transform() ์ฌ์ฉ ๋ฐฉ์ lamda ํํ๋ก ํต์ผ * refactor: ๋ฉ์๋ ๋ก์ง์ ๋ฐ๋ผ get, find ๋ช ์นญ ๊ตฌ๋ถ * refactor: lamda body ๋ด ์๋ต ๊ฐ๋ฅํ parameter ์๋ต * refactor: ๋ฉ์๋๋ช ๋ด ๋ถ์ ํํ ๋จ์ด ์ ๊ฑฐ(findGoalTimelineCountMap -> findGoalCountMap) * refactor: associateWith ๋ฉ์๋ ํ์ฉ * refactor: PaginationResult total๊ฐ Long์ผ๋ก ๋ค์ ๋ณ๊ฒฝ * fix: ๋ชฉํ ํผ๋ ์กฐํ API deadline ์ญ์์ผ๋ก ์ ๋ ฌ ์กฐํ * chore: apply lint * fix: goals ํ ์ด๋ธ์ index ์์ * refactor: pagination cusorId type Any -> Generic์ผ๋ก ๋ณ๊ฒฝ * fix: ํ์ ๋ผ์ธ ๋ชฉํ ์กฐํ API paging ์ฒ๋ฆฌ ๋ฐฉ์ offset์ผ๋ก ๋ณ๊ฒฝ * refactor: cursor ๊ธฐ๋ฐ pagination ๊ณตํต ๋ชจ๋ cursor type long์ผ๋ก ํต์ผ * refactor: pagination ๊ณตํต ๋ชจ๋ cursor์ offset ๊ตฌ๋ถ * refactor: ๋ฏธ์ฌ์ฉ ์ฝ๋ ๋ฐ ์๋ฏธ ์๋ ์ค๋ณต ์ฝ๋ ์ญ์
- Loading branch information
Showing
15 changed files
with
64 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...ication/api/src/main/kotlin/io/raemian/api/goal/controller/request/TimelinePageRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package io.raemian.api.goal.controller.request | ||
|
||
import java.time.LocalDateTime | ||
|
||
data class TimelinePageRequest( | ||
val cursor: LocalDateTime?, | ||
val size: Int, | ||
val page: Int = 0, | ||
val size: Int = 20, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
.../api/support/response/PaginationResult.kt โ ...upport/response/CursorPaginationResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...application/api/src/main/kotlin/io/raemian/api/support/response/OffsetPaginationResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.raemian.api.support.response | ||
|
||
data class OffsetPaginationResult<T>( | ||
val total: Long, | ||
val page: Int, | ||
val size: Int, | ||
val contents: List<T>, | ||
) { | ||
companion object { | ||
fun <T> of(page: Int, size: Int, total: Long, contents: List<T>): OffsetPaginationResult<T> { | ||
return OffsetPaginationResult(total, page, size, contents) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...db-core/src/main/kotlin/io/raemian/storage/db/core/common/pagination/CursorExtractable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package io.raemian.storage.db.core.common.pagination | ||
|
||
interface CursorExtractable<CursorType> { | ||
fun cursorId(): CursorType | ||
interface CursorExtractable { | ||
fun cursorId(): Long | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters