optimize imports
This commit is contained in:
parent
6961a866df
commit
bf8c04bc1f
@ -11,7 +11,6 @@ import com.insanusmokrassar.postssystem.utils.common.pagination.Pagination
|
|||||||
import com.insanusmokrassar.postssystem.utils.common.pagination.PaginationResult
|
import com.insanusmokrassar.postssystem.utils.common.pagination.PaginationResult
|
||||||
import com.soywiz.klock.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.request.get
|
|
||||||
import kotlinx.serialization.builtins.nullable
|
import kotlinx.serialization.builtins.nullable
|
||||||
|
|
||||||
class ReadPostsRepoKtorClient(
|
class ReadPostsRepoKtorClient(
|
||||||
|
@ -5,7 +5,6 @@ import com.insanusmokrassar.postssystem.core.content.api.WriteContentRepo
|
|||||||
import com.insanusmokrassar.postssystem.core.ktor.*
|
import com.insanusmokrassar.postssystem.core.ktor.*
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.*
|
import com.insanusmokrassar.postssystem.ktor.server.*
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.configurators.ApplicationRoutingConfigurator
|
import com.insanusmokrassar.postssystem.ktor.server.configurators.ApplicationRoutingConfigurator
|
||||||
import com.insanusmokrassar.postssystem.ktor.standardKtorSerialFormat
|
|
||||||
import io.ktor.application.call
|
import io.ktor.application.call
|
||||||
import io.ktor.routing.Route
|
import io.ktor.routing.Route
|
||||||
import io.ktor.routing.post
|
import io.ktor.routing.post
|
||||||
|
@ -5,7 +5,6 @@ import com.insanusmokrassar.postssystem.core.post.*
|
|||||||
import com.insanusmokrassar.postssystem.core.post.repo.WritePostsRepo
|
import com.insanusmokrassar.postssystem.core.post.repo.WritePostsRepo
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.*
|
import com.insanusmokrassar.postssystem.ktor.server.*
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.configurators.ApplicationRoutingConfigurator
|
import com.insanusmokrassar.postssystem.ktor.server.configurators.ApplicationRoutingConfigurator
|
||||||
import com.insanusmokrassar.postssystem.ktor.standardKtorSerialFormat
|
|
||||||
import io.ktor.application.call
|
import io.ktor.application.call
|
||||||
import io.ktor.routing.Route
|
import io.ktor.routing.Route
|
||||||
import io.ktor.routing.post
|
import io.ktor.routing.post
|
||||||
|
@ -8,7 +8,6 @@ import io.ktor.routing.Route
|
|||||||
import io.ktor.websocket.webSocket
|
import io.ktor.websocket.webSocket
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.collect
|
import kotlinx.coroutines.flow.collect
|
||||||
import kotlinx.serialization.DeserializationStrategy
|
|
||||||
import kotlinx.serialization.SerializationStrategy
|
import kotlinx.serialization.SerializationStrategy
|
||||||
|
|
||||||
private suspend fun DefaultWebSocketSession.checkReceivedAndCloseIfExists() {
|
private suspend fun DefaultWebSocketSession.checkReceivedAndCloseIfExists() {
|
||||||
|
@ -2,7 +2,6 @@ package com.insanusmokrassar.postssystem.ktor.server
|
|||||||
|
|
||||||
import com.insanusmokrassar.postssystem.ktor.standardKtorSerialFormat
|
import com.insanusmokrassar.postssystem.ktor.standardKtorSerialFormat
|
||||||
import io.ktor.application.ApplicationCall
|
import io.ktor.application.ApplicationCall
|
||||||
import io.ktor.application.call
|
|
||||||
import io.ktor.http.HttpStatusCode
|
import io.ktor.http.HttpStatusCode
|
||||||
import io.ktor.response.respond
|
import io.ktor.response.respond
|
||||||
import io.ktor.response.respondBytes
|
import io.ktor.response.respondBytes
|
||||||
|
@ -3,7 +3,7 @@ package com.insanusmokrassar.postssystem.ktor.server.configurators
|
|||||||
import io.ktor.application.Application
|
import io.ktor.application.Application
|
||||||
import io.ktor.application.install
|
import io.ktor.application.install
|
||||||
import io.ktor.features.StatusPages
|
import io.ktor.features.StatusPages
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.Contextual
|
||||||
|
|
||||||
class StatusPagesConfigurator(
|
class StatusPagesConfigurator(
|
||||||
private val elements: List<@Contextual Element>
|
private val elements: List<@Contextual Element>
|
||||||
|
@ -3,7 +3,6 @@ package com.insanusmokrassar.postssystem.ktor.tests
|
|||||||
import com.insanusmokrassar.postssystem.ktor.client.createStandardWebsocketFlow
|
import com.insanusmokrassar.postssystem.ktor.client.createStandardWebsocketFlow
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.createKtorServer
|
import com.insanusmokrassar.postssystem.ktor.server.createKtorServer
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.includeWebsocketHandling
|
import com.insanusmokrassar.postssystem.ktor.server.includeWebsocketHandling
|
||||||
import com.insanusmokrassar.postssystem.ktor.standardKtorSerialFormat
|
|
||||||
import io.ktor.application.install
|
import io.ktor.application.install
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.routing.routing
|
import io.ktor.routing.routing
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package com.insanusmokrassar.postssystem.publishing.ktor.client
|
package com.insanusmokrassar.postssystem.publishing.ktor.client
|
||||||
|
|
||||||
import com.insanusmokrassar.postssystem.core.publishing.repos.PublishingKeysRepo
|
import com.insanusmokrassar.postssystem.core.publishing.repos.*
|
||||||
import com.insanusmokrassar.postssystem.core.publishing.repos.ReadPublishingKeysRepo
|
|
||||||
import com.insanusmokrassar.postssystem.core.publishing.repos.WritePublishingKeysRepo
|
|
||||||
import com.insanusmokrassar.postssystem.publishing.ktor.publishingKeysRootRoute
|
import com.insanusmokrassar.postssystem.publishing.ktor.publishingKeysRootRoute
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.features.websocket.WebSockets
|
import io.ktor.client.features.websocket.WebSockets
|
||||||
|
@ -6,9 +6,7 @@ import com.insanusmokrassar.postssystem.core.publishing.repos.WritePublishingKey
|
|||||||
import com.insanusmokrassar.postssystem.ktor.buildStandardUrl
|
import com.insanusmokrassar.postssystem.ktor.buildStandardUrl
|
||||||
import com.insanusmokrassar.postssystem.ktor.client.BodyPair
|
import com.insanusmokrassar.postssystem.ktor.client.BodyPair
|
||||||
import com.insanusmokrassar.postssystem.ktor.client.unipost
|
import com.insanusmokrassar.postssystem.ktor.client.unipost
|
||||||
import com.insanusmokrassar.postssystem.publishing.ktor.SetPostTriggerControlKeyObject
|
import com.insanusmokrassar.postssystem.publishing.ktor.*
|
||||||
import com.insanusmokrassar.postssystem.publishing.ktor.setPostTriggerControlKeyRoute
|
|
||||||
import com.insanusmokrassar.postssystem.publishing.ktor.unsetPostTriggerControlKeyRoute
|
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
|
|
||||||
|
@ -4,9 +4,7 @@ import com.insanusmokrassar.postssystem.core.post.PostId
|
|||||||
import com.insanusmokrassar.postssystem.core.publishing.repos.WritePublishingKeysRepo
|
import com.insanusmokrassar.postssystem.core.publishing.repos.WritePublishingKeysRepo
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.unianswer
|
import com.insanusmokrassar.postssystem.ktor.server.unianswer
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.uniload
|
import com.insanusmokrassar.postssystem.ktor.server.uniload
|
||||||
import com.insanusmokrassar.postssystem.publishing.ktor.SetPostTriggerControlKeyObject
|
import com.insanusmokrassar.postssystem.publishing.ktor.*
|
||||||
import com.insanusmokrassar.postssystem.publishing.ktor.setPostTriggerControlKeyRoute
|
|
||||||
import com.insanusmokrassar.postssystem.publishing.ktor.unsetPostTriggerControlKeyRoute
|
|
||||||
import io.ktor.application.call
|
import io.ktor.application.call
|
||||||
import io.ktor.routing.Route
|
import io.ktor.routing.Route
|
||||||
import io.ktor.routing.post
|
import io.ktor.routing.post
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import requests
|
|
||||||
from bs4 import BeautifulSoup
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import itertools
|
import pandas as pd
|
||||||
|
|
||||||
|
|
||||||
def fix_name(category, raw_name):
|
def fix_name(category, raw_name):
|
||||||
splitted = raw_name.replace('-', '+').replace('.', '+').replace(',', '+').split('+')
|
splitted = raw_name.replace('-', '+').replace('.', '+').replace(',', '+').split('+')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.insanusmokrassar.postssystem.utils.common
|
package com.insanusmokrassar.postssystem.utils.common
|
||||||
|
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.KSerializer
|
||||||
import kotlinx.serialization.builtins.ByteArraySerializer
|
import kotlinx.serialization.builtins.ByteArraySerializer
|
||||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
import kotlinx.serialization.encoding.Decoder
|
import kotlinx.serialization.encoding.Decoder
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
package com.insanusmokrassar.postssystem.utils.common
|
package com.insanusmokrassar.postssystem.utils.common
|
||||||
|
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.KSerializer
|
||||||
|
import kotlinx.serialization.Serializer
|
||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.Decoder
|
import kotlinx.serialization.encoding.Decoder
|
||||||
import kotlinx.serialization.encoding.Encoder
|
import kotlinx.serialization.encoding.Encoder
|
||||||
|
import kotlin.collections.forEach
|
||||||
|
import kotlin.collections.getOrPut
|
||||||
|
import kotlin.collections.mutableMapOf
|
||||||
|
import kotlin.collections.set
|
||||||
|
|
||||||
private val mimesCache = mutableMapOf<String, MimeType>().also {
|
private val mimesCache = mutableMapOf<String, MimeType>().also {
|
||||||
knownMimeTypes.forEach { mimeType -> it[mimeType.raw] = mimeType }
|
knownMimeTypes.forEach { mimeType -> it[mimeType.raw] = mimeType }
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package com.insanusmokrassar.postssystem.utils.repos.ktor.client.crud
|
package com.insanusmokrassar.postssystem.utils.repos.ktor.client.crud
|
||||||
|
|
||||||
import com.insanusmokrassar.postssystem.ktor.*
|
import com.insanusmokrassar.postssystem.ktor.buildStandardUrl
|
||||||
import com.insanusmokrassar.postssystem.ktor.client.*
|
import com.insanusmokrassar.postssystem.ktor.client.*
|
||||||
import com.insanusmokrassar.postssystem.utils.repos.*
|
import com.insanusmokrassar.postssystem.utils.repos.UpdatedValuePair
|
||||||
|
import com.insanusmokrassar.postssystem.utils.repos.WriteStandardCRUDRepo
|
||||||
import com.insanusmokrassar.postssystem.utils.repos.ktor.common.*
|
import com.insanusmokrassar.postssystem.utils.repos.ktor.common.*
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
package com.insanusmokrassar.postssystem.utils.repos.ktor.client.one_to_many
|
package com.insanusmokrassar.postssystem.utils.repos.ktor.client.one_to_many
|
||||||
|
|
||||||
import com.insanusmokrassar.postssystem.utils.repos.OneToManyKeyValueRepo
|
import com.insanusmokrassar.postssystem.utils.repos.*
|
||||||
import com.insanusmokrassar.postssystem.utils.repos.OneToManyReadKeyValueRepo
|
import io.ktor.client.HttpClient
|
||||||
import com.insanusmokrassar.postssystem.utils.repos.OneToManyWriteKeyValueRepo
|
|
||||||
import io.ktor.client.*
|
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
|
|
||||||
class KtorOneToManyKeyValueRepo<Key, Value>(
|
class KtorOneToManyKeyValueRepo<Key, Value>(
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.insanusmokrassar.postssystem.utils.repos.ktor.server.crud
|
package com.insanusmokrassar.postssystem.utils.repos.ktor.server.crud
|
||||||
|
|
||||||
import com.insanusmokrassar.postssystem.utils.repos.*
|
import com.insanusmokrassar.postssystem.utils.repos.StandardCRUDRepo
|
||||||
import io.ktor.routing.*
|
import io.ktor.routing.Route
|
||||||
|
import io.ktor.routing.route
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
|
|
||||||
fun <ObjectType, IdType, InputValue> Route.configureStandardCrudRepoRoutes(
|
fun <ObjectType, IdType, InputValue> Route.configureStandardCrudRepoRoutes(
|
||||||
|
@ -4,7 +4,8 @@ import com.insanusmokrassar.postssystem.ktor.server.*
|
|||||||
import com.insanusmokrassar.postssystem.utils.repos.WriteStandardCRUDRepo
|
import com.insanusmokrassar.postssystem.utils.repos.WriteStandardCRUDRepo
|
||||||
import com.insanusmokrassar.postssystem.utils.repos.ktor.common.*
|
import com.insanusmokrassar.postssystem.utils.repos.ktor.common.*
|
||||||
import io.ktor.application.call
|
import io.ktor.application.call
|
||||||
import io.ktor.routing.*
|
import io.ktor.routing.Route
|
||||||
|
import io.ktor.routing.post
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
import kotlinx.serialization.builtins.*
|
import kotlinx.serialization.builtins.*
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.insanusmokrassar.postssystem.utils.repos.ktor.server.one_to_many
|
package com.insanusmokrassar.postssystem.utils.repos.ktor.server.one_to_many
|
||||||
|
|
||||||
import com.insanusmokrassar.postssystem.utils.repos.OneToManyKeyValueRepo
|
import com.insanusmokrassar.postssystem.utils.repos.OneToManyKeyValueRepo
|
||||||
import io.ktor.routing.*
|
import io.ktor.routing.Route
|
||||||
|
import io.ktor.routing.route
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
|
|
||||||
fun <Key, Value> Route.configureOneToManyKeyValueRepoRoutes(
|
fun <Key, Value> Route.configureOneToManyKeyValueRepoRoutes(
|
||||||
|
Loading…
Reference in New Issue
Block a user