mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-20 15:47:15 +00:00
encode by default pages number
This commit is contained in:
parent
703094c924
commit
087d7452fd
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.micro_utils.pagination
|
package dev.inmo.micro_utils.pagination
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.*
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@ -10,6 +10,7 @@ data class PaginationResult<T>(
|
|||||||
val results: List<T>,
|
val results: List<T>,
|
||||||
val objectsCount: Long
|
val objectsCount: Long
|
||||||
) : Pagination {
|
) : Pagination {
|
||||||
|
@EncodeDefault
|
||||||
val pagesNumber: Int = ceil(objectsCount / size.toFloat()).toInt()
|
val pagesNumber: Int = ceil(objectsCount / size.toFloat()).toInt()
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
Loading…
Reference in New Issue
Block a user