Skip to content

Commit

Permalink
Refactor packages
Browse files Browse the repository at this point in the history
  • Loading branch information
IRus committed Oct 10, 2024
1 parent b205207 commit 4960cde
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion komok-app/src/main/kotlin/io/heapy/komok/Application.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@file:JvmName("Application")
package io.heapy.komok

import io.heapy.komok.business.ServerModule
import io.heapy.komok.infra.http.server.ServerModule
import io.heapy.komok.infra.uptime.JvmUptime
import io.heapy.komok.tech.logging.Logger
import io.heapy.komok.infra.uptime.JvmUptimeModule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package io.heapy.komok.business

import io.heapy.komok.business.healthcheck.HealthCheckRoute
import io.heapy.komok.server.common.KomokRoute
import io.heapy.komok.server.common.KomokRoutes
import io.heapy.komok.tech.di.lib.Module

@Module
open class AnonymousRoutesModule {
open val anonymousRoutes: KomokRoutes by lazy {
open val anonymousRoutes: KomokRoute by lazy {
KomokRoutes(
routes = listOf(
healthCheckRoute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package io.heapy.komok.business

import io.heapy.komok.business.entity.EntityModule
import io.heapy.komok.business.user.UserRoute
import io.heapy.komok.infra.http.server.AuthenticatedRoutes
import io.heapy.komok.server.common.KomokRoute
import io.heapy.komok.server.common.KomokRoutes
import io.heapy.komok.tech.di.lib.Module

Expand All @@ -13,12 +15,18 @@ open class AuthenticatedRoutesModule(
UserRoute()
}

open val authenticatedRoutes by lazy {
open val routes: KomokRoute by lazy {
KomokRoutes(
routes = listOf(
userRoute,
entityModule.routes,
),
)
}

open val authenticatedRoutes: KomokRoute by lazy {
AuthenticatedRoutes(
routes = routes,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.server.common.KomokRoute
import io.ktor.server.auth.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.server.common.KomokServerFeature
import io.ktor.server.application.Application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import com.auth0.jwt.JWT
import com.auth0.jwt.algorithms.Algorithm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.server.common.KomokServerFeature
import io.ktor.server.application.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.business.login.JwtModule
import io.heapy.komok.metrics.MetricsModule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.tech.config.ConfigurationModule
import io.heapy.komok.tech.di.lib.Module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.tech.di.lib.Module
import io.ktor.server.cio.CIO
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.business.AnonymousRoutesModule
import io.heapy.komok.business.AuthenticatedRoutesModule
import io.heapy.komok.server.common.KomokRoutes
import io.heapy.komok.tech.di.lib.Module

Expand All @@ -14,9 +16,7 @@ open class ServerRoutingConfigurationModule(
listOf(
staticFilesRoute,
anonymousRoutesModule.anonymousRoutes,
AuthenticatedRoutes(
routes = authenticatedRoutesModule.authenticatedRoutes,
),
authenticatedRoutesModule.authenticatedRoutes,
),
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.server.common.KomokRoute
import io.ktor.server.http.content.CompressedFileType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import io.heapy.komok.server.common.KomokServerFeature
import io.ktor.server.application.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("FunctionName")

package io.heapy.komok.business
package io.heapy.komok.infra.http.server

import kotlinx.serialization.Serializable

Expand Down

0 comments on commit 4960cde

Please sign in to comment.