Skip to content

Commit

Permalink
Optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonman01 committed Dec 6, 2024
1 parent 6e2d820 commit 08f845f
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 43 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/com/wire/bots/polls/PollBot.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.wire.bots.polls

import com.wire.bots.polls.setup.init
import io.ktor.application.Application
import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
import io.ktor.application.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*

fun main() {
embeddedServer(Netty, 8080, module = Application::init).start()
Expand Down
11 changes: 5 additions & 6 deletions src/main/kotlin/com/wire/bots/polls/routing/MessagesRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import com.wire.bots.polls.services.AuthService
import com.wire.bots.polls.services.MessagesHandlingService
import com.wire.bots.polls.setup.logging.USER_ID
import com.wire.bots.polls.utils.mdc
import io.ktor.application.call
import io.ktor.http.HttpStatusCode
import io.ktor.request.receive
import io.ktor.response.respond
import io.ktor.routing.Routing
import io.ktor.routing.post
import io.ktor.application.*
import io.ktor.http.*
import io.ktor.request.*
import io.ktor.response.*
import io.ktor.routing.*
import org.kodein.di.instance
import org.kodein.di.ktor.closestDI

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/wire/bots/polls/routing/Routing.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.wire.bots.polls.routing

import com.wire.bots.polls.utils.createLogger
import io.ktor.routing.Routing
import io.ktor.routing.*

internal val routingLogger by lazy { createLogger("RoutingLogger") }

Expand Down
10 changes: 4 additions & 6 deletions src/main/kotlin/com/wire/bots/polls/routing/ServiceRoutes.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.wire.bots.polls.routing

import com.wire.bots.polls.dao.DatabaseSetup
import io.ktor.application.call
import io.ktor.http.HttpStatusCode
import io.ktor.response.respond
import io.ktor.response.respondTextWriter
import io.ktor.routing.Routing
import io.ktor.routing.get
import io.ktor.application.*
import io.ktor.http.*
import io.ktor.response.*
import io.ktor.routing.*
import io.micrometer.prometheus.PrometheusMeterRegistry
import org.kodein.di.instance
import org.kodein.di.ktor.closestDI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.wire.bots.polls.services

import io.ktor.http.Headers
import io.ktor.http.*
import mu.KLogging
import pw.forst.katlib.whenNull

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.wire.bots.polls.services
import com.wire.bots.polls.dto.PollAction
import com.wire.bots.polls.dto.UsersInput
import com.wire.bots.polls.dto.roman.Message
import io.ktor.features.BadRequestException
import io.ktor.features.*
import mu.KLogging

class MessagesHandlingService(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.wire.bots.polls.parser.PollFactory
import mu.KLogging
import pw.forst.katlib.whenNull
import pw.forst.katlib.whenTrue
import java.util.UUID
import java.util.*

/**
* Service handling the polls. It communicates with the proxy via [proxySenderService].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import io.ktor.client.request.post
import io.ktor.client.request.url
import io.ktor.client.statement.HttpStatement
import io.ktor.client.statement.readText
import io.ktor.http.ContentType
import io.ktor.http.*
import io.ktor.http.contentType
import io.ktor.http.isSuccess
import mu.KLogging
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/wire/bots/polls/setup/KodeinSetup.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.wire.bots.polls.setup

import io.ktor.application.Application
import io.ktor.application.*
import org.kodein.di.ktor.di

/**
Expand Down
20 changes: 7 additions & 13 deletions src/main/kotlin/com/wire/bots/polls/setup/KtorInstallation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,20 @@ import com.wire.bots.polls.setup.errors.registerExceptionHandlers
import com.wire.bots.polls.setup.logging.APP_REQUEST
import com.wire.bots.polls.setup.logging.INFRA_REQUEST
import com.wire.bots.polls.utils.createLogger
import io.ktor.application.Application
import io.ktor.application.install
import io.ktor.features.CallId
import io.ktor.features.CallLogging
import io.ktor.features.ContentNegotiation
import io.ktor.features.DefaultHeaders
import io.ktor.features.callId
import io.ktor.jackson.jackson
import io.ktor.metrics.micrometer.MicrometerMetrics
import io.ktor.request.header
import io.ktor.request.uri
import io.ktor.routing.routing
import io.ktor.application.*
import io.ktor.features.*
import io.ktor.jackson.*
import io.ktor.metrics.micrometer.*
import io.ktor.request.*
import io.ktor.routing.*
import io.micrometer.core.instrument.distribution.DistributionStatisticConfig
import io.micrometer.prometheus.PrometheusMeterRegistry
import org.flywaydb.core.Flyway
import org.kodein.di.instance
import org.kodein.di.ktor.closestDI
import org.slf4j.event.Level
import java.text.DateFormat
import java.util.UUID
import java.util.*


private val installationLogger = createLogger("ApplicationSetup")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ package com.wire.bots.polls.setup.errors

import com.wire.bots.polls.utils.countException
import com.wire.bots.polls.utils.createLogger
import io.ktor.application.Application
import io.ktor.application.ApplicationCall
import io.ktor.application.call
import io.ktor.application.install
import io.ktor.features.StatusPages
import io.ktor.http.HttpStatusCode
import io.ktor.response.respond
import io.ktor.application.*
import io.ktor.features.*
import io.ktor.http.*
import io.ktor.response.*
import io.micrometer.prometheus.PrometheusMeterRegistry
import org.kodein.di.instance
import org.kodein.di.ktor.closestDI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.wire.bots.polls.setup.errors

import io.ktor.http.HttpStatusCode
import io.ktor.http.*

data class RomanUnavailableException(
val status: HttpStatusCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.ktor.client.features.HttpClientFeature
import io.ktor.client.statement.HttpReceivePipeline
import io.ktor.client.statement.HttpResponse
import io.ktor.client.statement.request
import io.ktor.util.AttributeKey
import io.ktor.util.*
import mu.KLogging

/**
Expand Down

0 comments on commit 08f845f

Please sign in to comment.