encode by default pages number

This commit is contained in:
InsanusMokrassar 2022-07-26 14:54:52 +06:00
parent 703094c924
commit 087d7452fd

View File

@ -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(