From 8055003b479d73a2bd9e564092d50a405569be11 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 11 Oct 2022 12:58:29 +0600 Subject: [PATCH] deprecations removing --- CHANGELOG.md | 2 + .../ktor/client/FlowsWebsockets.kt | 82 ------ .../ktor/client/StandardHttpClientGetPost.kt | 260 ------------------ .../micro_utils/ktor/server/FlowsWebsocket.kt | 61 ---- .../ktor/server/ServerRoutingShortcuts.kt | 197 ------------- .../pagination/PaginationResult.kt | 12 - 6 files changed, 2 insertions(+), 612 deletions(-) delete mode 100644 ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/FlowsWebsockets.kt delete mode 100644 ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/StandardHttpClientGetPost.kt delete mode 100644 ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/FlowsWebsocket.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index e302bb016a7..0bfa204b4c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.13.0 +**ALL DEPRECATIONS HAVE BEEN REMOVED** + * `Repos`: * `Exposed`: * `AbstractExposedWriteCRUDRepo` got two new methods: `update` with `it` as `UpdateBuilder` and `createAndInsertId` diff --git a/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/FlowsWebsockets.kt b/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/FlowsWebsockets.kt deleted file mode 100644 index c2d9dc3b8c6..00000000000 --- a/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/FlowsWebsockets.kt +++ /dev/null @@ -1,82 +0,0 @@ -package dev.inmo.micro_utils.ktor.client - -import dev.inmo.micro_utils.coroutines.runCatchingSafely -import dev.inmo.micro_utils.coroutines.safely -import dev.inmo.micro_utils.ktor.common.* -import io.ktor.client.HttpClient -import io.ktor.client.plugins.pluginOrNull -import io.ktor.client.plugins.websocket.WebSockets -import io.ktor.client.plugins.websocket.ws -import io.ktor.client.request.HttpRequestBuilder -import io.ktor.websocket.Frame -import io.ktor.websocket.readBytes -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.channelFlow -import kotlinx.coroutines.isActive -import kotlinx.serialization.DeserializationStrategy - -/** - * @param checkReconnection This lambda will be called when it is required to reconnect to websocket to establish - * connection. Must return true in case if must be reconnected. By default always reconnecting - */ -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -inline fun HttpClient.createStandardWebsocketFlow( - url: String, - crossinline checkReconnection: suspend (Throwable?) -> Boolean = { true }, - noinline requestBuilder: HttpRequestBuilder.() -> Unit = {}, - crossinline conversation: suspend (StandardKtorSerialInputData) -> T -): Flow { - pluginOrNull(WebSockets) ?: error("Plugin $WebSockets must be installed for using createStandardWebsocketFlow") - - val correctedUrl = url.asCorrectWebSocketUrl - - return channelFlow { - do { - val reconnect = runCatchingSafely { - ws(correctedUrl, requestBuilder) { - for (received in incoming) { - when (received) { - is Frame.Binary -> send(conversation(received.data)) - else -> { - close() - return@ws - } - } - } - } - checkReconnection(null) - }.getOrElse { e -> - checkReconnection(e).also { - if (!it) { - close(e) - } - } - } - } while (reconnect && isActive) - - if (isActive) { - safely { - close() - } - } - } -} - -/** - * @param checkReconnection This lambda will be called when it is required to reconnect to websocket to establish - * connection. Must return true in case if must be reconnected. By default always reconnecting - */ -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -inline fun HttpClient.createStandardWebsocketFlow( - url: String, - deserializer: DeserializationStrategy, - crossinline checkReconnection: suspend (Throwable?) -> Boolean = { true }, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat, - noinline requestBuilder: HttpRequestBuilder.() -> Unit = {}, -) = createStandardWebsocketFlow( - url, - checkReconnection, - requestBuilder -) { - serialFormat.decodeDefault(deserializer, it) -} diff --git a/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/StandardHttpClientGetPost.kt b/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/StandardHttpClientGetPost.kt deleted file mode 100644 index f9c327ec27e..00000000000 --- a/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/StandardHttpClientGetPost.kt +++ /dev/null @@ -1,260 +0,0 @@ -package dev.inmo.micro_utils.ktor.client - -import dev.inmo.micro_utils.common.MPPFile -import dev.inmo.micro_utils.common.filename -import dev.inmo.micro_utils.ktor.common.* -import io.ktor.client.HttpClient -import io.ktor.client.call.body -import io.ktor.client.request.* -import io.ktor.client.request.forms.* -import io.ktor.client.statement.readBytes -import io.ktor.http.* -import io.ktor.utils.io.core.ByteReadPacket -import kotlinx.serialization.* - -@Deprecated("This class will be removed soon. It is now recommended to use built-in ktor features instead") -class UnifiedRequester( - val client: HttpClient = HttpClient(), - val serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat -) { - suspend fun uniget( - url: String, - resultDeserializer: DeserializationStrategy - ): ResultType = client.uniget(url, resultDeserializer, serialFormat) - - fun encodeUrlQueryValue( - serializationStrategy: SerializationStrategy, - value: T - ) = serializationStrategy.encodeUrlQueryValue( - value, - serialFormat - ) - - suspend fun unipost( - url: String, - bodyInfo: Pair, BodyType>, - resultDeserializer: DeserializationStrategy - ) = client.unipost(url, bodyInfo, resultDeserializer, serialFormat) - - suspend fun unimultipart( - url: String, - filename: String, - inputProvider: InputProvider, - resultDeserializer: DeserializationStrategy, - mimetype: String = "*/*", - additionalParametersBuilder: FormBuilder.() -> Unit = {}, - dataHeadersBuilder: HeadersBuilder.() -> Unit = {}, - requestBuilder: HttpRequestBuilder.() -> Unit = {}, - ): ResultType = client.unimultipart(url, filename, inputProvider, resultDeserializer, mimetype, additionalParametersBuilder, dataHeadersBuilder, requestBuilder, serialFormat) - - suspend fun unimultipart( - url: String, - filename: String, - inputProvider: InputProvider, - otherData: Pair, BodyType>, - resultDeserializer: DeserializationStrategy, - mimetype: String = "*/*", - additionalParametersBuilder: FormBuilder.() -> Unit = {}, - dataHeadersBuilder: HeadersBuilder.() -> Unit = {}, - requestBuilder: HttpRequestBuilder.() -> Unit = {}, - ): ResultType = client.unimultipart(url, filename, otherData, inputProvider, resultDeserializer, mimetype, additionalParametersBuilder, dataHeadersBuilder, requestBuilder, serialFormat) - - suspend fun unimultipart( - url: String, - mppFile: MPPFile, - resultDeserializer: DeserializationStrategy, - mimetype: String = "*/*", - additionalParametersBuilder: FormBuilder.() -> Unit = {}, - dataHeadersBuilder: HeadersBuilder.() -> Unit = {}, - requestBuilder: HttpRequestBuilder.() -> Unit = {} - ): ResultType = client.unimultipart( - url, mppFile, resultDeserializer, mimetype, additionalParametersBuilder, dataHeadersBuilder, requestBuilder, serialFormat - ) - - suspend fun unimultipart( - url: String, - mppFile: MPPFile, - otherData: Pair, BodyType>, - resultDeserializer: DeserializationStrategy, - mimetype: String = "*/*", - additionalParametersBuilder: FormBuilder.() -> Unit = {}, - dataHeadersBuilder: HeadersBuilder.() -> Unit = {}, - requestBuilder: HttpRequestBuilder.() -> Unit = {} - ): ResultType = client.unimultipart( - url, mppFile, otherData, resultDeserializer, mimetype, additionalParametersBuilder, dataHeadersBuilder, requestBuilder, serialFormat - ) - - fun createStandardWebsocketFlow( - url: String, - checkReconnection: suspend (Throwable?) -> Boolean, - deserializer: DeserializationStrategy, - requestBuilder: HttpRequestBuilder.() -> Unit = {}, - ) = client.createStandardWebsocketFlow(url, deserializer, checkReconnection, serialFormat, requestBuilder) - - fun createStandardWebsocketFlow( - url: String, - deserializer: DeserializationStrategy, - requestBuilder: HttpRequestBuilder.() -> Unit = {}, - ) = createStandardWebsocketFlow(url, { true }, deserializer, requestBuilder) -} - -@Deprecated("This property will be removed soon. It is now recommended to use built-in ktor features instead") -val defaultRequester = UnifiedRequester() - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun HttpClient.uniget( - url: String, - resultDeserializer: DeserializationStrategy, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat -) = get(url).let { - serialFormat.decodeDefault(resultDeserializer, it.body()) -} - - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -fun SerializationStrategy.encodeUrlQueryValue( - value: T, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat -) = serialFormat.encodeHex( - this, - value -) - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun HttpClient.unipost( - url: String, - bodyInfo: Pair, BodyType>, - resultDeserializer: DeserializationStrategy, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat -) = post(url) { - setBody( - serialFormat.encodeDefault(bodyInfo.first, bodyInfo.second) - ) -}.let { - serialFormat.decodeDefault(resultDeserializer, it.body()) -} - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun HttpClient.unimultipart( - url: String, - filename: String, - inputProvider: InputProvider, - resultDeserializer: DeserializationStrategy, - mimetype: String = "*/*", - additionalParametersBuilder: FormBuilder.() -> Unit = {}, - dataHeadersBuilder: HeadersBuilder.() -> Unit = {}, - requestBuilder: HttpRequestBuilder.() -> Unit = {}, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat -): ResultType = submitFormWithBinaryData( - url, - formData = formData { - append( - "bytes", - inputProvider, - Headers.build { - append(HttpHeaders.ContentType, mimetype) - append(HttpHeaders.ContentDisposition, "filename=\"$filename\"") - dataHeadersBuilder() - } - ) - additionalParametersBuilder() - } -) { - requestBuilder() -}.let { serialFormat.decodeDefault(resultDeserializer, it.body()) } - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun HttpClient.unimultipart( - url: String, - filename: String, - otherData: Pair, BodyType>, - inputProvider: InputProvider, - resultDeserializer: DeserializationStrategy, - mimetype: String = "*/*", - additionalParametersBuilder: FormBuilder.() -> Unit = {}, - dataHeadersBuilder: HeadersBuilder.() -> Unit = {}, - requestBuilder: HttpRequestBuilder.() -> Unit = {}, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat -): ResultType = unimultipart( - url, - filename, - inputProvider, - resultDeserializer, - mimetype, - additionalParametersBuilder = { - val serialized = serialFormat.encodeDefault(otherData.first, otherData.second) - append( - "data", - InputProvider(serialized.size.toLong()) { - ByteReadPacket(serialized) - }, - Headers.build { - append(HttpHeaders.ContentType, ContentType.Application.Cbor.contentType) - append(HttpHeaders.ContentDisposition, "filename=data.bytes") - dataHeadersBuilder() - } - ) - additionalParametersBuilder() - }, - dataHeadersBuilder, - requestBuilder, - serialFormat -) - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun HttpClient.unimultipart( - url: String, - mppFile: MPPFile, - resultDeserializer: DeserializationStrategy, - mimetype: String = "*/*", - additionalParametersBuilder: FormBuilder.() -> Unit = {}, - dataHeadersBuilder: HeadersBuilder.() -> Unit = {}, - requestBuilder: HttpRequestBuilder.() -> Unit = {}, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat -): ResultType = unimultipart( - url, - mppFile.filename.string, - mppFile.inputProvider(), - resultDeserializer, - mimetype, - additionalParametersBuilder, - dataHeadersBuilder, - requestBuilder, - serialFormat -) - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun HttpClient.unimultipart( - url: String, - mppFile: MPPFile, - otherData: Pair, BodyType>, - resultDeserializer: DeserializationStrategy, - mimetype: String = "*/*", - additionalParametersBuilder: FormBuilder.() -> Unit = {}, - dataHeadersBuilder: HeadersBuilder.() -> Unit = {}, - requestBuilder: HttpRequestBuilder.() -> Unit = {}, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat -): ResultType = unimultipart( - url, - mppFile, - resultDeserializer, - mimetype, - additionalParametersBuilder = { - val serialized = serialFormat.encodeDefault(otherData.first, otherData.second) - append( - "data", - InputProvider(serialized.size.toLong()) { - ByteReadPacket(serialized) - }, - Headers.build { - append(HttpHeaders.ContentType, ContentType.Application.Cbor.contentType) - append(HttpHeaders.ContentDisposition, "filename=data.bytes") - dataHeadersBuilder() - } - ) - additionalParametersBuilder() - }, - dataHeadersBuilder, - requestBuilder, - serialFormat -) diff --git a/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/FlowsWebsocket.kt b/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/FlowsWebsocket.kt deleted file mode 100644 index 3760e60ad4b..00000000000 --- a/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/FlowsWebsocket.kt +++ /dev/null @@ -1,61 +0,0 @@ -package dev.inmo.micro_utils.ktor.server - -import dev.inmo.micro_utils.coroutines.safely -import dev.inmo.micro_utils.ktor.common.* -import io.ktor.http.URLProtocol -import io.ktor.server.application.install -import io.ktor.server.application.pluginOrNull -import io.ktor.server.routing.Route -import io.ktor.server.routing.application -import io.ktor.server.websocket.* -import io.ktor.websocket.send -import kotlinx.coroutines.flow.Flow -import kotlinx.serialization.SerializationStrategy - -@Deprecated("This method will be removed soon") -fun Route.includeWebsocketHandling( - suburl: String, - flow: Flow, - protocol: URLProtocol? = null, - converter: suspend WebSocketServerSession.(T) -> StandardKtorSerialInputData? -) { - application.apply { - pluginOrNull(WebSockets) ?: install(WebSockets) - } - webSocket(suburl, protocol ?.name) { - safely { - flow.collect { - converter(it) ?.let { data -> - send(data) - } - } - } - } -} - -@Deprecated("This method will be removed soon") -fun Route.includeWebsocketHandling( - suburl: String, - flow: Flow, - serializer: SerializationStrategy, - serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat, - protocol: URLProtocol? = null, - filter: (suspend WebSocketServerSession.(T) -> Boolean)? = null -) = includeWebsocketHandling( - suburl, - flow, - protocol, - converter = if (filter == null) { - { - serialFormat.encodeDefault(serializer, it) - } - } else { - { - if (filter(it)) { - serialFormat.encodeDefault(serializer, it) - } else { - null - } - } - } -) diff --git a/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/ServerRoutingShortcuts.kt b/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/ServerRoutingShortcuts.kt index d44914c72dc..968a3607d11 100644 --- a/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/ServerRoutingShortcuts.kt +++ b/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/ServerRoutingShortcuts.kt @@ -19,106 +19,6 @@ import kotlinx.coroutines.flow.Flow import kotlinx.serialization.DeserializationStrategy import kotlinx.serialization.SerializationStrategy -@Deprecated("This class method will be removed soon. It is now recommended to use built-in ktor features instead") -class UnifiedRouter( - val serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat, - val serialFormatContentType: ContentType = standardKtorSerialFormatContentType -) { - fun Route.includeWebsocketHandling( - suburl: String, - flow: Flow, - serializer: SerializationStrategy, - protocol: URLProtocol? = null, - filter: (suspend WebSocketServerSession.(T) -> Boolean)? = null - ) = includeWebsocketHandling(suburl, flow, serializer, serialFormat, protocol, filter) - - suspend fun PipelineContext<*, ApplicationCall>.unianswer( - answerSerializer: SerializationStrategy, - answer: T - ) { - call.respondBytes ( - serialFormat.encodeDefault(answerSerializer, answer), - serialFormatContentType - ) - } - - suspend fun PipelineContext<*, ApplicationCall>.uniload( - deserializer: DeserializationStrategy - ) = safely { - serialFormat.decodeDefault( - deserializer, - call.receive() - ) - } - - suspend fun PipelineContext<*, ApplicationCall>.getParameterOrSendError( - field: String - ) = call.parameters[field].also { - if (it == null) { - call.respond(HttpStatusCode.BadRequest, "Request must contains $field") - } - } - - fun PipelineContext<*, ApplicationCall>.getQueryParameter( - field: String - ) = call.request.queryParameters[field] - - suspend fun PipelineContext<*, ApplicationCall>.getQueryParameterOrSendError( - field: String - ) = getQueryParameter(field).also { - if (it == null) { - call.respond(HttpStatusCode.BadRequest, "Request query parameters must contains $field") - } - } - - fun PipelineContext<*, ApplicationCall>.decodeUrlQueryValue( - field: String, - deserializer: DeserializationStrategy - ) = getQueryParameter(field) ?.let { - serialFormat.decodeHex( - deserializer, - it - ) - } - - suspend fun PipelineContext<*, ApplicationCall>.decodeUrlQueryValueOrSendError( - field: String, - deserializer: DeserializationStrategy - ) = decodeUrlQueryValue(field, deserializer).also { - if (it == null) { - call.respond(HttpStatusCode.BadRequest, "Request query parameters must contains $field") - } - } - - companion object { - val default - get() = defaultUnifiedRouter - } -} - -val defaultUnifiedRouter = UnifiedRouter() - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun ApplicationCall.unianswer( - answerSerializer: SerializationStrategy, - answer: T -) { - respondBytes ( - standardKtorSerialFormat.encodeDefault(answerSerializer, answer), - standardKtorSerialFormatContentType - ) -} - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun ApplicationCall.uniload( - deserializer: DeserializationStrategy -) = safely { - standardKtorSerialFormat.decodeDefault( - deserializer, - receive() - ) -} - suspend fun ApplicationCall.uniloadMultipart( onFormItem: (PartData.FormItem) -> Unit = {}, onCustomFileItem: (PartData.FileItem) -> Unit = {}, @@ -146,82 +46,6 @@ suspend fun ApplicationCall.uniloadMultipart( resultInput ?: error("Bytes has not been received") } -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun ApplicationCall.uniloadMultipart( - deserializer: DeserializationStrategy, - onFormItem: (PartData.FormItem) -> Unit = {}, - onCustomFileItem: (PartData.FileItem) -> Unit = {}, - onBinaryChannelItem: (PartData.BinaryChannelItem) -> Unit = {}, - onBinaryContent: (PartData.BinaryItem) -> Unit = {} -): Pair { - var data: Optional? = null - val resultInput = uniloadMultipart( - onFormItem, - { - if (it.name == "data") { - data = standardKtorSerialFormat.decodeDefault(deserializer, it.provider().readBytes()).optional - } else { - onCustomFileItem(it) - } - }, - onBinaryChannelItem, - onBinaryContent - ) - - val completeData = data ?: error("Data has not been received") - return resultInput to (completeData.dataOrNull().let { it as T }) -} - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun ApplicationCall.uniloadMultipartFile( - deserializer: DeserializationStrategy, - onFormItem: (PartData.FormItem) -> Unit = {}, - onCustomFileItem: (PartData.FileItem) -> Unit = {}, - onBinaryChannelItem: (PartData.BinaryChannelItem) -> Unit = {}, - onBinaryContent: (PartData.BinaryItem) -> Unit = {}, -) = safely { - val multipartData = receiveMultipart() - - var resultInput: MPPFile? = null - var data: Optional? = null - - multipartData.forEachPart { - when (it) { - is PartData.FormItem -> onFormItem(it) - is PartData.FileItem -> { - when (it.name) { - "bytes" -> { - val name = FileName(it.originalFileName ?: error("File name is unknown for default part")) - resultInput = MPPFile.createTempFile( - name.nameWithoutExtension.let { - var resultName = it - while (resultName.length < 3) { - resultName += "_" - } - resultName - }, - ".${name.extension}" - ).apply { - outputStream().use { fileStream -> - it.streamProvider().use { - it.copyTo(fileStream) - } - } - } - } - "data" -> data = standardKtorSerialFormat.decodeDefault(deserializer, it.provider().readBytes()).optional - else -> onCustomFileItem(it) - } - } - is PartData.BinaryItem -> onBinaryContent(it) - is PartData.BinaryChannelItem -> onBinaryChannelItem(it) - } - } - - val completeData = data ?: error("Data has not been received") - (resultInput ?: error("Bytes has not been received")) to (completeData.dataOrNull().let { it as T }) -} - suspend fun ApplicationCall.uniloadMultipartFile( onFormItem: (PartData.FormItem) -> Unit = {}, onCustomFileItem: (PartData.FileItem) -> Unit = {}, @@ -285,24 +109,3 @@ suspend fun ApplicationCall.getQueryParameterOrSendError( respond(HttpStatusCode.BadRequest, "Request query parameters must contains $field") } } - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -fun ApplicationCall.decodeUrlQueryValue( - field: String, - deserializer: DeserializationStrategy -) = getQueryParameter(field) ?.let { - standardKtorSerialFormat.decodeHex( - deserializer, - it - ) -} - -@Deprecated("This method will be removed soon. It is now recommended to use built-in ktor features instead") -suspend fun ApplicationCall.decodeUrlQueryValueOrSendError( - field: String, - deserializer: DeserializationStrategy -) = decodeUrlQueryValue(field, deserializer).also { - if (it == null) { - respond(HttpStatusCode.BadRequest, "Request query parameters must contains $field") - } -} diff --git a/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/PaginationResult.kt b/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/PaginationResult.kt index 3abd96bc9b5..9c88e91c53a 100644 --- a/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/PaginationResult.kt +++ b/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/PaginationResult.kt @@ -33,18 +33,6 @@ data class PaginationResult( results, (pagesNumber * size).toLong() ) - @Deprecated("Replace with The other order of incoming parameters or objectsCount parameter") - constructor( - page: Int, - pagesNumber: Int, - results: List, - size: Int - ) : this( - page, - results, - pagesNumber, - size - ) } fun emptyPaginationResult() = PaginationResult(0, 0, emptyList(), 0L)