All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.dev.inmo.micro_utils.pagination.ServerPaginationHelpers.kt Maven / Gradle / Ivy

There is a newer version: 0.22.3
Show newest version
package dev.inmo.micro_utils.pagination

import io.ktor.http.Parameters
import io.ktor.server.application.ApplicationCall

val Parameters.extractPagination: Pagination
    get() = SimplePagination(
        get(paginationPageKey) ?.toIntOrNull() ?: 0,
        get(paginationSizeKey) ?.toIntOrNull() ?: defaultPaginationPageSize
    )

val ApplicationCall.extractPagination: Pagination
    get() = request.queryParameters.extractPagination





© 2015 - 2024 Weber Informatics LLC | Privacy Policy