mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-20 07:37: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
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.*
|
||||
import kotlin.math.ceil
|
||||
|
||||
@Serializable
|
||||
@ -10,6 +10,7 @@ data class PaginationResult<T>(
|
||||
val results: List<T>,
|
||||
val objectsCount: Long
|
||||
) : Pagination {
|
||||
@EncodeDefault
|
||||
val pagesNumber: Int = ceil(objectsCount / size.toFloat()).toInt()
|
||||
|
||||
constructor(
|
||||
|
Loading…
Reference in New Issue
Block a user