diff --git a/commonApp/build.gradle.kts b/commonApp/build.gradle.kts index 7a30568..6d5180f 100644 --- a/commonApp/build.gradle.kts +++ b/commonApp/build.gradle.kts @@ -6,9 +6,10 @@ kotlin { sourceSets.apply { commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:network")) + implementation(project(":core:network:client")) + implementation(project(":core:network:api")) implementation(project(":core:database")) - implementation(project(":core:ui")) + implementation(project(":core:ui:kit")) implementation(project(":core:navigation")) implementation(project(":feature:film_feed")) diff --git a/commonApp/src/commonMain/kotlin/com/stslex/wizard/App.kt b/commonApp/src/commonMain/kotlin/com/stslex/wizard/App.kt index df45e5c..b09790f 100644 --- a/commonApp/src/commonMain/kotlin/com/stslex/wizard/App.kt +++ b/commonApp/src/commonMain/kotlin/com/stslex/wizard/App.kt @@ -2,7 +2,7 @@ package com.stslex.wizard import androidx.compose.runtime.Composable import com.stslex.wizard.config.KoinApp -import com.stslex.wizard.core.ui.theme.AppTheme +import com.stslex.wizard.core.ui.kit.theme.AppTheme import org.koin.core.KoinApplication @Composable diff --git a/commonApp/src/commonMain/kotlin/com/stslex/wizard/InitialApp.kt b/commonApp/src/commonMain/kotlin/com/stslex/wizard/InitialApp.kt index 7e6ac0e..92dc2c7 100644 --- a/commonApp/src/commonMain/kotlin/com/stslex/wizard/InitialApp.kt +++ b/commonApp/src/commonMain/kotlin/com/stslex/wizard/InitialApp.kt @@ -22,7 +22,7 @@ import com.stslex.wizard.bottom_bar.BottomAppBarResource.Companion.getByRoute import com.stslex.wizard.bottom_bar.MainBottomAppBar import com.stslex.wizard.core.core.Logger import com.stslex.wizard.core.navigation.Screen -import com.stslex.wizard.core.network.utils.token.AuthController +import com.stslex.wizard.core.network.api.utils.token.AuthController import com.stslex.wizard.host.AppNavigationHost import org.koin.compose.getKoin diff --git a/commonApp/src/commonMain/kotlin/com/stslex/wizard/di/appModule.kt b/commonApp/src/commonMain/kotlin/com/stslex/wizard/di/appModule.kt index 8740d95..90a9435 100644 --- a/commonApp/src/commonMain/kotlin/com/stslex/wizard/di/appModule.kt +++ b/commonApp/src/commonMain/kotlin/com/stslex/wizard/di/appModule.kt @@ -5,8 +5,9 @@ import com.stslex.wizard.core.core.ModuleCore import com.stslex.wizard.core.core.modules import com.stslex.wizard.core.database.di.ModuleCoreDatabase import com.stslex.wizard.core.navigation.di.ModuleCoreNavigation -import com.stslex.wizard.core.network.di.ModuleCoreNetwork -import com.stslex.wizard.core.ui.di.ModuleCoreUi +import com.stslex.wizard.core.network.api.di.ModuleCoreNetworkApi +import com.stslex.wizard.core.network.client.di.ModuleCoreNetworkClient +import com.stslex.wizard.core.ui.kit.di.ModuleCoreUi import com.stslex.wizard.feature.auth.di.ModuleFeatureAuth import com.stslex.wizard.feature.favourite.di.ModuleFeatureFavourite import com.stslex.wizard.feature.film.di.ModuleFeatureFilm @@ -20,7 +21,8 @@ import com.stslex.wizard.feature.settings.di.ModuleFeatureSettings fun appModules(navHostController: NavHostController) = listOf( ModuleCore(), ModuleCoreUi(), - ModuleCoreNetwork(), + ModuleCoreNetworkClient(), + ModuleCoreNetworkApi(), ModuleCoreNavigation(navHostController), ModuleCoreDatabase(), ModuleFeatureFeed(), diff --git a/core/navigation/build.gradle.kts b/core/navigation/build.gradle.kts index 4c51696..c65612b 100644 --- a/core/navigation/build.gradle.kts +++ b/core/navigation/build.gradle.kts @@ -5,7 +5,7 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) + implementation(project(":core:ui:kit")) api(libs.compose.navigation) } diff --git a/core/network/build.gradle.kts b/core/network/api/build.gradle.kts similarity index 95% rename from core/network/build.gradle.kts rename to core/network/api/build.gradle.kts index 5e234e6..be5a2c8 100644 --- a/core/network/build.gradle.kts +++ b/core/network/api/build.gradle.kts @@ -11,6 +11,7 @@ kotlin { sourceSets { commonMain.dependencies { implementation(project(":core:core")) + implementation(project(":core:network:client")) implementation(project(":core:database")) implementation(libs.bundles.ktor) implementation(libs.slf4j.simple) @@ -38,4 +39,4 @@ fun BuildConfigExtension.buildStringField(localProperties: Properties, name: Str fun Properties.getString(key: String): String { return getProperty(key) ?: throw IllegalStateException("$key should be initialised") -} +} \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/BaseNetworkClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/base/BaseNetworkClient.kt similarity index 53% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/BaseNetworkClient.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/base/BaseNetworkClient.kt index 0495f1a..c1a9e34 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/BaseNetworkClient.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/base/BaseNetworkClient.kt @@ -1,17 +1,15 @@ -package com.stslex.wizard.core.network.api.base +package com.stslex.wizard.core.network.api.api.base import com.stslex.wizard.core.core.AppDispatcher -import com.stslex.wizard.core.network.api.base.NetworkClientBuilder.setupDefaultRequest -import com.stslex.wizard.core.network.api.base.NetworkClientBuilder.setupLogging -import com.stslex.wizard.core.network.api.base.NetworkClientBuilder.setupNegotiation -import com.stslex.wizard.core.network.api.base.model.DefaultRequest +import com.stslex.wizard.core.network.client.DefaultRequest +import com.stslex.wizard.core.network.client.NetworkClientBuilder.setupDefaultRequest import io.ktor.client.HttpClient -import io.ktor.client.engine.cio.CIO import io.ktor.client.plugins.cache.HttpCache import kotlinx.coroutines.withContext open class BaseNetworkClient( private val appDispatcher: AppDispatcher, + client: HttpClient, defaultRequest: DefaultRequest = DefaultRequest.EMPTY ) : NetworkClient { @@ -21,10 +19,8 @@ open class BaseNetworkClient( request(client) } - private val client: HttpClient = HttpClient(CIO) { - setupNegotiation() + private val client: HttpClient = client.config { install(HttpCache) - setupLogging() expectSuccess = true setupDefaultRequest(defaultRequest) } diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/NetworkClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/base/NetworkClient.kt similarity index 69% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/NetworkClient.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/base/NetworkClient.kt index be31229..43eaafb 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/NetworkClient.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/base/NetworkClient.kt @@ -1,10 +1,9 @@ -package com.stslex.wizard.core.network.api.base +package com.stslex.wizard.core.network.api.api.base -import com.stslex.wizard.core.network.api.base.NetworkClient.Companion.PARAMETER_PAGE -import com.stslex.wizard.core.network.api.base.NetworkClient.Companion.PARAMETER_PAGE_SIZE -import com.stslex.wizard.core.network.api.base.NetworkClient.Companion.PARAMETER_QUERY -import com.stslex.wizard.core.network.api.base.NetworkClient.Companion.PARAMETER_UUID -import com.stslex.wizard.core.network.model.PagingRequest +import com.stslex.wizard.core.network.api.api.base.NetworkClient.Companion.PARAMETER_PAGE +import com.stslex.wizard.core.network.api.api.base.NetworkClient.Companion.PARAMETER_PAGE_SIZE +import com.stslex.wizard.core.network.api.api.base.NetworkClient.Companion.PARAMETER_QUERY +import com.stslex.wizard.core.network.api.api.base.NetworkClient.Companion.PARAMETER_UUID import io.ktor.client.HttpClient import io.ktor.client.call.body import io.ktor.client.request.HttpRequestBuilder @@ -42,7 +41,7 @@ internal suspend inline fun NetworkClient.post( }.body() } -internal fun HttpRequestBuilder.requestPaging(request: PagingRequest) { +internal fun HttpRequestBuilder.requestPaging(request: com.stslex.wizard.core.network.api.model.PagingRequest) { parameter(PARAMETER_UUID, request.uuid) parameter(PARAMETER_QUERY, request.query) parameter(PARAMETER_PAGE, request.page) diff --git a/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/api/KinopoiskApiClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/api/KinopoiskApiClient.kt new file mode 100644 index 0000000..781fa84 --- /dev/null +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/api/KinopoiskApiClient.kt @@ -0,0 +1,5 @@ +package com.stslex.wizard.core.network.api.api.kinopoisk.api + +import com.stslex.wizard.core.network.api.api.base.NetworkClient + +interface KinopoiskApiClient : NetworkClient diff --git a/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/api/KinopoiskApiClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/api/KinopoiskApiClientImpl.kt new file mode 100644 index 0000000..d68b306 --- /dev/null +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/api/KinopoiskApiClientImpl.kt @@ -0,0 +1,35 @@ +package com.stslex.wizard.core.network.api.api.kinopoisk.api + +import Wizard.core.network.api.BuildConfig +import com.stslex.wizard.core.core.AppDispatcher +import com.stslex.wizard.core.network.api.api.base.BaseNetworkClient +import com.stslex.wizard.core.network.client.DefaultRequest +import io.ktor.client.HttpClient + +class KinopoiskApiClientImpl( + appDispatcher: AppDispatcher, + client: HttpClient +) : KinopoiskApiClient, BaseNetworkClient( + appDispatcher = appDispatcher, + client = client, + defaultRequest = DEFAULT_REQUEST +) { + + companion object { + // TODO parse error + private const val KINOPOISK_HOST_URL = "kinopoiskapiunofficial.tech/api/v2.2" + private const val API_KEY = BuildConfig.KINOPOISK_API_KEY + private const val API_HEADER = "X-API-KEY" + private const val CONTENT_TYPE = "Content-Type" + private const val CONTENT_TYPE_VALUE = "application/json" + + private val DEFAULT_REQUEST = + DefaultRequest( + hostUrl = KINOPOISK_HOST_URL, + headers = mapOf( + API_HEADER to API_KEY, + CONTENT_TYPE to CONTENT_TYPE_VALUE + ) + ) + } +} \ No newline at end of file diff --git a/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/NetworkApiKinopoiskMapper.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/NetworkApiKinopoiskMapper.kt new file mode 100644 index 0000000..41255b7 --- /dev/null +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/NetworkApiKinopoiskMapper.kt @@ -0,0 +1,96 @@ +package com.stslex.wizard.core.network.api.api.kinopoisk.model + +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.FilmItemKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.FilmListKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.FilmProductionStatusNetwork +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.FilmTypeNetwork +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.MovieKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.TrailerItemKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.TrailerKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.response.FilmItemResponse +import com.stslex.wizard.core.network.api.api.kinopoisk.model.response.FilmListResponse +import com.stslex.wizard.core.network.api.api.kinopoisk.model.response.MovieResponse +import com.stslex.wizard.core.network.api.api.kinopoisk.model.response.TrailerItemResponse +import com.stslex.wizard.core.network.api.api.kinopoisk.model.response.TrailerResponse +import com.stslex.wizard.core.network.api.clients.film.model.TrailerSiteType + +fun FilmListResponse.toNetwork(): FilmListKinopoisk = FilmListKinopoisk( + total = total ?: 0, + totalPages = totalPages ?: 0, + items = items?.map { it.toNetwork() }.orEmpty() +) + +fun FilmItemResponse.toNetwork(): FilmItemKinopoisk = FilmItemKinopoisk( + kinopoiskId = kinopoiskId, + imdbId = imdbId.orEmpty(), + nameRu = nameRu.orEmpty(), + nameEn = nameEn.orEmpty(), + nameOriginal = nameOriginal.orEmpty(), + countries = countries?.map { it.country }.orEmpty(), + genres = genres?.map { it.genre }.orEmpty(), + ratingKinopoisk = ratingKinopoisk, + ratingImdb = ratingImdb, + year = year, + posterUrl = posterUrl.orEmpty(), + posterUrlPreview = posterUrlPreview.orEmpty(), + type = FilmTypeNetwork.getType(type.orEmpty()) +) + +fun TrailerResponse.toNetwork(): TrailerKinopoisk = TrailerKinopoisk( + total = total ?: 0, + items = items?.map { it.toNetwork() }.orEmpty() +) + +fun TrailerItemResponse.toNetwork(): TrailerItemKinopoisk = TrailerItemKinopoisk( + url = url.orEmpty(), + name = name.orEmpty(), + site = TrailerSiteType.getByValue(site.orEmpty()), +) + +fun MovieResponse.toNetwork(): MovieKinopoisk = MovieKinopoisk( + kinopoiskId = kinopoiskId, + kinopoiskHDId = kinopoiskHDId.orEmpty(), + imdbId = imdbId.orEmpty(), + nameRu = nameRu.orEmpty(), + nameEn = nameEn.orEmpty(), + nameOriginal = nameOriginal.orEmpty(), + posterUrl = posterUrl.orEmpty(), + posterUrlPreview = posterUrlPreview.orEmpty(), + coverUrl = coverUrl.orEmpty(), + logoUrl = logoUrl.orEmpty(), + reviewsCount = reviewsCount, + ratingGoodReview = ratingGoodReview, + ratingGoodReviewVoteCount = ratingGoodReviewVoteCount, + ratingKinopoisk = ratingKinopoisk, + ratingKinopoiskVoteCount = ratingKinopoiskVoteCount, + ratingImdb = ratingImdb, + ratingImdbVoteCount = ratingImdbVoteCount, + ratingFilmCritics = ratingFilmCritics, + ratingFilmCriticsVoteCount = ratingFilmCriticsVoteCount, + ratingAwait = ratingAwait, + ratingAwaitCount = ratingAwaitCount, + ratingRfCritics = ratingRfCritics, + ratingRfCriticsVoteCount = ratingRfCriticsVoteCount, + webUrl = webUrl.orEmpty(), + year = year, + filmLength = filmLength, + slogan = slogan.orEmpty(), + description = description, + shortDescription = shortDescription.orEmpty(), + editorAnnotation = editorAnnotation.orEmpty(), + isTicketsAvailable = isTicketsAvailable ?: false, + productionStatus = FilmProductionStatusNetwork.getType(productionStatus.orEmpty()), + type = type, + ratingMpaa = ratingMpaa, + ratingAgeLimits = ratingAgeLimits, + hasImax = hasImax ?: false, + has3D = has3D ?: false, + lastSync = lastSync, + countries = countries?.map { it.country }.orEmpty(), + genres = genres?.map { it.genre }.orEmpty(), + startYear = startYear, + endYear = endYear, + isSerial = serial ?: false, + isShortFilm = shortFilm ?: false, + isCompleted = completed ?: false +) \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmItemKinopoisk.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmItemKinopoisk.kt similarity index 84% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmItemKinopoisk.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmItemKinopoisk.kt index 85f4a13..3bbe16f 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmItemKinopoisk.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmItemKinopoisk.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.network +package com.stslex.wizard.core.network.api.api.kinopoisk.model.network data class FilmItemKinopoisk( val kinopoiskId: Int, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmListKinopoisk.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmListKinopoisk.kt similarity index 62% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmListKinopoisk.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmListKinopoisk.kt index 3763be4..66d6897 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmListKinopoisk.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmListKinopoisk.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.network +package com.stslex.wizard.core.network.api.api.kinopoisk.model.network data class FilmListKinopoisk( val total: Int, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmProductionStatusNetwork.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmProductionStatusNetwork.kt similarity index 85% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmProductionStatusNetwork.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmProductionStatusNetwork.kt index 18cc69b..6a5838a 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmProductionStatusNetwork.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmProductionStatusNetwork.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.network +package com.stslex.wizard.core.network.api.api.kinopoisk.model.network enum class FilmProductionStatusNetwork(val value: String) { FILMING("FILMING"), diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmTypeNetwork.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmTypeNetwork.kt similarity index 84% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmTypeNetwork.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmTypeNetwork.kt index eb17718..5ae1ae5 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/FilmTypeNetwork.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/FilmTypeNetwork.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.network +package com.stslex.wizard.core.network.api.api.kinopoisk.model.network enum class FilmTypeNetwork(val value: String) { FILM("FILM"), diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/MovieKinopoisk.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/MovieKinopoisk.kt similarity index 95% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/MovieKinopoisk.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/MovieKinopoisk.kt index 7948ea4..b8da4bd 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/MovieKinopoisk.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/MovieKinopoisk.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.network +package com.stslex.wizard.core.network.api.api.kinopoisk.model.network data class MovieKinopoisk( val kinopoiskId: Int, diff --git a/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/TrailerItemKinopoisk.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/TrailerItemKinopoisk.kt new file mode 100644 index 0000000..8da9094 --- /dev/null +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/TrailerItemKinopoisk.kt @@ -0,0 +1,9 @@ +package com.stslex.wizard.core.network.api.api.kinopoisk.model.network + +import com.stslex.wizard.core.network.api.clients.film.model.TrailerSiteType + +data class TrailerItemKinopoisk( + val url: String, + val name: String, + val site: TrailerSiteType +) \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/TrailerKinopoisk.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/TrailerKinopoisk.kt similarity index 56% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/TrailerKinopoisk.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/TrailerKinopoisk.kt index d53b6b1..3f6cffd 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/TrailerKinopoisk.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/network/TrailerKinopoisk.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.network +package com.stslex.wizard.core.network.api.api.kinopoisk.model.network data class TrailerKinopoisk( val total: Int, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/request/FilmsRequest.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/request/FilmsRequest.kt similarity index 70% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/request/FilmsRequest.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/request/FilmsRequest.kt index 0dfb5eb..761fb10 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/request/FilmsRequest.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/request/FilmsRequest.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.request +package com.stslex.wizard.core.network.api.api.kinopoisk.model.request import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/CountryResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/CountryResponse.kt similarity index 71% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/CountryResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/CountryResponse.kt index c7ded70..f421eee 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/CountryResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/CountryResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.response +package com.stslex.wizard.core.network.api.api.kinopoisk.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/FilmItemResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/FilmItemResponse.kt similarity index 92% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/FilmItemResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/FilmItemResponse.kt index 01918ac..bfde185 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/FilmItemResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/FilmItemResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.response +package com.stslex.wizard.core.network.api.api.kinopoisk.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/FilmListResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/FilmListResponse.kt similarity index 80% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/FilmListResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/FilmListResponse.kt index 1f90a3b..ca23eff 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/FilmListResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/FilmListResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.response +package com.stslex.wizard.core.network.api.api.kinopoisk.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/GenreResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/GenreResponse.kt similarity index 70% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/GenreResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/GenreResponse.kt index 7454aea..390bf77 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/GenreResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/GenreResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.response +package com.stslex.wizard.core.network.api.api.kinopoisk.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/MovieResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/MovieResponse.kt similarity index 97% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/MovieResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/MovieResponse.kt index f598951..be1fd61 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/MovieResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/MovieResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.response +package com.stslex.wizard.core.network.api.api.kinopoisk.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/TrailerItemResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/TrailerItemResponse.kt similarity index 78% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/TrailerItemResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/TrailerItemResponse.kt index 8d10cfb..9bcdd25 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/TrailerItemResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/TrailerItemResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.response +package com.stslex.wizard.core.network.api.api.kinopoisk.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/TrailerResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/TrailerResponse.kt similarity index 77% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/TrailerResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/TrailerResponse.kt index 750182e..ebbee4e 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/response/TrailerResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/model/response/TrailerResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.response +package com.stslex.wizard.core.network.api.api.kinopoisk.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/source/KinopoiskNetworkClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/source/KinopoiskNetworkClient.kt new file mode 100644 index 0000000..a3b4299 --- /dev/null +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/source/KinopoiskNetworkClient.kt @@ -0,0 +1,14 @@ +package com.stslex.wizard.core.network.api.api.kinopoisk.source + +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.FilmListKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.MovieKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.TrailerKinopoisk + +interface KinopoiskNetworkClient { + + suspend fun getFilms(page: Int): FilmListKinopoisk + + suspend fun getFilm(id: String): MovieKinopoisk + + suspend fun getFilmTrailers(id: String): TrailerKinopoisk +} diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/source/KinopoiskNetworkClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/source/KinopoiskNetworkClientImpl.kt similarity index 54% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/source/KinopoiskNetworkClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/source/KinopoiskNetworkClientImpl.kt index 13c0de1..1718ede 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/source/KinopoiskNetworkClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/kinopoisk/source/KinopoiskNetworkClientImpl.kt @@ -1,13 +1,13 @@ -package com.stslex.wizard.core.network.api.kinopoisk.source +package com.stslex.wizard.core.network.api.api.kinopoisk.source -import com.stslex.wizard.core.network.api.kinopoisk.api.KinopoiskApiClient -import com.stslex.wizard.core.network.api.kinopoisk.model.network.FilmListKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.MovieKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.TrailerKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.response.FilmListResponse -import com.stslex.wizard.core.network.api.kinopoisk.model.response.MovieResponse -import com.stslex.wizard.core.network.api.kinopoisk.model.response.TrailerResponse -import com.stslex.wizard.core.network.api.kinopoisk.model.toNetwork +import com.stslex.wizard.core.network.api.api.kinopoisk.api.KinopoiskApiClient +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.FilmListKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.MovieKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.TrailerKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.response.FilmListResponse +import com.stslex.wizard.core.network.api.api.kinopoisk.model.response.MovieResponse +import com.stslex.wizard.core.network.api.api.kinopoisk.model.response.TrailerResponse +import com.stslex.wizard.core.network.api.api.kinopoisk.model.toNetwork import io.ktor.client.call.body import io.ktor.client.request.get import io.ktor.client.request.parameter @@ -25,10 +25,7 @@ class KinopoiskNetworkClientImpl( .toNetwork() override suspend fun getFilm(id: String): MovieKinopoisk = apiClient - .request { - get("$ENDPOINT_FILMS/$id") - .body() - } + .request { get("$ENDPOINT_FILMS/$id").body() } .toNetwork() override suspend fun getFilmTrailers(id: String): TrailerKinopoisk = apiClient diff --git a/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/client/ServerApiClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/client/ServerApiClient.kt new file mode 100644 index 0000000..ae6c252 --- /dev/null +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/client/ServerApiClient.kt @@ -0,0 +1,5 @@ +package com.stslex.wizard.core.network.api.api.server.client + +import com.stslex.wizard.core.network.api.api.base.NetworkClient + +interface ServerApiClient : NetworkClient diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/client/ServerApiClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/client/ServerApiClientImpl.kt similarity index 71% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/client/ServerApiClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/client/ServerApiClientImpl.kt index b24a633..2700910 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/client/ServerApiClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/client/ServerApiClientImpl.kt @@ -1,8 +1,8 @@ -package com.stslex.wizard.core.network.api.server.client +package com.stslex.wizard.core.network.api.api.server.client import com.stslex.wizard.core.core.AppDispatcher -import com.stslex.wizard.core.network.api.server.http_client.ServerHttpClient -import com.stslex.wizard.core.network.api.server.model.ErrorRepeatEnd +import com.stslex.wizard.core.network.api.api.server.http_client.ServerHttpClient +import com.stslex.wizard.core.network.api.api.server.model.ErrorRepeatEnd import io.ktor.client.HttpClient import kotlinx.coroutines.withContext diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/ErrorHandler.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/ErrorHandler.kt similarity index 62% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/ErrorHandler.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/ErrorHandler.kt index 78cbe19..d8a03d9 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/ErrorHandler.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/ErrorHandler.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.server.error_handler +package com.stslex.wizard.core.network.api.api.server.error_handler import io.ktor.client.plugins.CallRequestExceptionHandler diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/ErrorHandlerImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/ErrorHandlerImpl.kt similarity index 73% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/ErrorHandlerImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/ErrorHandlerImpl.kt index 863542e..14d707d 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/ErrorHandlerImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/ErrorHandlerImpl.kt @@ -1,11 +1,11 @@ -package com.stslex.wizard.core.network.api.server.error_handler +package com.stslex.wizard.core.network.api.api.server.error_handler -import com.stslex.wizard.core.network.api.server.error_handler.RefreshTokenValidator.setupResponseValidator -import com.stslex.wizard.core.network.api.server.http_client.ServerHttpClient -import com.stslex.wizard.core.network.api.server.model.ErrorRepeatEnd -import com.stslex.wizard.core.network.api.server.model.TokenResponseModel -import com.stslex.wizard.core.network.utils.token.AuthController -import com.stslex.wizard.core.network.utils.token.toModel +import com.stslex.wizard.core.network.api.api.server.error_handler.RefreshTokenValidator.setupResponseValidator +import com.stslex.wizard.core.network.api.api.server.http_client.ServerHttpClient +import com.stslex.wizard.core.network.api.api.server.model.ErrorRepeatEnd +import com.stslex.wizard.core.network.api.api.server.model.TokenResponseModel +import com.stslex.wizard.core.network.api.utils.token.AuthController +import com.stslex.wizard.core.network.api.utils.token.toModel import io.ktor.client.call.body import io.ktor.client.plugins.ResponseException import io.ktor.client.request.HttpRequest diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/RefreshTokenValidator.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/RefreshTokenValidator.kt similarity index 92% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/RefreshTokenValidator.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/RefreshTokenValidator.kt index 192f9a7..9aab905 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/RefreshTokenValidator.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/error_handler/RefreshTokenValidator.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.server.error_handler +package com.stslex.wizard.core.network.api.api.server.error_handler import com.stslex.wizard.core.core.error.ErrorRefresh import io.ktor.client.HttpClient diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/http_client/ServerHttpClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/http_client/ServerHttpClient.kt similarity index 65% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/http_client/ServerHttpClient.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/http_client/ServerHttpClient.kt index 4b45ed6..cb34307 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/http_client/ServerHttpClient.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/http_client/ServerHttpClient.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.server.http_client +package com.stslex.wizard.core.network.api.api.server.http_client import io.ktor.client.HttpClient diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/http_client/ServerHttpClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/http_client/ServerHttpClientImpl.kt similarity index 70% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/http_client/ServerHttpClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/http_client/ServerHttpClientImpl.kt index d43541d..f1bba6e 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/http_client/ServerHttpClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/http_client/ServerHttpClientImpl.kt @@ -1,12 +1,9 @@ -package com.stslex.wizard.core.network.api.server.http_client +package com.stslex.wizard.core.network.api.api.server.http_client -import Wizard.core.network.BuildConfig -import com.stslex.wizard.core.network.api.base.NetworkClientBuilder.setupLogging -import com.stslex.wizard.core.network.api.base.NetworkClientBuilder.setupNegotiation -import com.stslex.wizard.core.network.api.server.error_handler.ErrorHandler -import com.stslex.wizard.core.network.utils.token.AuthController +import Wizard.core.network.api.BuildConfig +import com.stslex.wizard.core.network.api.api.server.error_handler.ErrorHandler +import com.stslex.wizard.core.network.api.utils.token.AuthController import io.ktor.client.HttpClient -import io.ktor.client.engine.cio.CIO import io.ktor.client.plugins.HttpResponseValidator import io.ktor.client.plugins.auth.Auth import io.ktor.client.plugins.auth.providers.BearerTokens @@ -19,12 +16,11 @@ import io.ktor.http.contentType class ServerHttpClientImpl( private val errorHandler: ErrorHandler, - private val tokenProvider: AuthController + private val tokenProvider: AuthController, + httpClient: HttpClient ) : ServerHttpClient { - override val client: HttpClient = HttpClient(CIO) { - setupNegotiation() - setupLogging() + override val client: HttpClient = httpClient.config { expectSuccess = true HttpResponseValidator { handleResponseExceptionWithRequest(errorHandler) @@ -40,7 +36,10 @@ class ServerHttpClientImpl( } ) headers { - append(API_KEY_NAME, BuildConfig.SERVER_API_KEY) + append( + API_KEY_NAME, + BuildConfig.SERVER_API_KEY + ) } } } diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/ErrorRepeatEnd.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/model/ErrorRepeatEnd.kt similarity index 74% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/ErrorRepeatEnd.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/model/ErrorRepeatEnd.kt index cf71d71..d5010a3 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/ErrorRepeatEnd.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/model/ErrorRepeatEnd.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.server.model +package com.stslex.wizard.core.network.api.api.server.model /** * Error repeat request. diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/TokenResponseModel.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/model/TokenResponseModel.kt similarity index 85% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/TokenResponseModel.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/model/TokenResponseModel.kt index b902c12..7897f6f 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/TokenResponseModel.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/api/server/model/TokenResponseModel.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.server.model +package com.stslex.wizard.core.network.api.api.server.model import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/client/AuthClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/client/AuthClient.kt similarity index 58% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/client/AuthClient.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/client/AuthClient.kt index 66128bc..41c1e9e 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/client/AuthClient.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/client/AuthClient.kt @@ -1,6 +1,6 @@ -package com.stslex.wizard.core.network.clients.auth.client +package com.stslex.wizard.core.network.api.clients.auth.client -import com.stslex.wizard.core.network.clients.auth.response.LoginOkResponse +import com.stslex.wizard.core.network.api.clients.auth.response.LoginOkResponse interface AuthClient { @@ -8,4 +8,3 @@ interface AuthClient { suspend fun registerUser(login: String, username: String, password: String): LoginOkResponse } - diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/client/AuthClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/client/AuthClientImpl.kt similarity index 71% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/client/AuthClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/client/AuthClientImpl.kt index 3ca95e2..4bca3cf 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/client/AuthClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/client/AuthClientImpl.kt @@ -1,11 +1,11 @@ -package com.stslex.wizard.core.network.clients.auth.client +package com.stslex.wizard.core.network.api.clients.auth.client -import com.stslex.wizard.core.network.api.server.client.ServerApiClient -import com.stslex.wizard.core.network.clients.auth.request.LoginRequest -import com.stslex.wizard.core.network.clients.auth.request.RegisterRequest -import com.stslex.wizard.core.network.clients.auth.response.LoginOkResponse -import com.stslex.wizard.core.network.utils.token.AuthController -import com.stslex.wizard.core.network.utils.token.toModel +import com.stslex.wizard.core.network.api.api.server.client.ServerApiClient +import com.stslex.wizard.core.network.api.clients.auth.request.LoginRequest +import com.stslex.wizard.core.network.api.clients.auth.request.RegisterRequest +import com.stslex.wizard.core.network.api.clients.auth.response.LoginOkResponse +import com.stslex.wizard.core.network.api.utils.token.AuthController +import com.stslex.wizard.core.network.api.utils.token.toModel import io.ktor.client.call.body import io.ktor.client.request.post import io.ktor.client.request.setBody diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/request/LoginRequest.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/request/LoginRequest.kt similarity index 77% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/request/LoginRequest.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/request/LoginRequest.kt index ec74a09..7185c16 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/request/LoginRequest.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/request/LoginRequest.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.auth.request +package com.stslex.wizard.core.network.api.clients.auth.request import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/request/RegisterRequest.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/request/RegisterRequest.kt similarity index 81% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/request/RegisterRequest.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/request/RegisterRequest.kt index 7fd9c77..c2b3647 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/request/RegisterRequest.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/request/RegisterRequest.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.auth.request +package com.stslex.wizard.core.network.api.clients.auth.request import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/response/LoginOkResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/response/LoginOkResponse.kt similarity index 84% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/response/LoginOkResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/response/LoginOkResponse.kt index 5760e92..d4d8487 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/auth/response/LoginOkResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/auth/response/LoginOkResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.auth.response +package com.stslex.wizard.core.network.api.clients.auth.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/FilmClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/FilmClient.kt similarity index 50% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/FilmClient.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/FilmClient.kt index 3101067..7aae1ac 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/FilmClient.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/FilmClient.kt @@ -1,8 +1,8 @@ -package com.stslex.wizard.core.network.clients.film.client +package com.stslex.wizard.core.network.api.clients.film.client -import com.stslex.wizard.core.network.clients.film.model.FilmListNetwork -import com.stslex.wizard.core.network.clients.film.model.FilmTrailerNetwork -import com.stslex.wizard.core.network.clients.film.model.MovieNetwork +import com.stslex.wizard.core.network.api.clients.film.model.FilmListNetwork +import com.stslex.wizard.core.network.api.clients.film.model.FilmTrailerNetwork +import com.stslex.wizard.core.network.api.clients.film.model.MovieNetwork interface FilmClient { diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/FilmClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/FilmClientImpl.kt similarity index 59% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/FilmClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/FilmClientImpl.kt index 0f57138..a5fb0fc 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/FilmClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/FilmClientImpl.kt @@ -1,11 +1,11 @@ -package com.stslex.wizard.core.network.clients.film.client +package com.stslex.wizard.core.network.api.clients.film.client -import com.stslex.wizard.core.network.api.base.NetworkClient -import com.stslex.wizard.core.network.api.kinopoisk.source.KinopoiskNetworkClient -import com.stslex.wizard.core.network.clients.film.model.FilmListNetwork -import com.stslex.wizard.core.network.clients.film.model.FilmTrailerNetwork -import com.stslex.wizard.core.network.clients.film.model.MovieNetwork -import com.stslex.wizard.core.network.clients.film.model.toNetwork +import com.stslex.wizard.core.network.api.api.base.NetworkClient +import com.stslex.wizard.core.network.api.api.kinopoisk.source.KinopoiskNetworkClient +import com.stslex.wizard.core.network.api.clients.film.model.FilmListNetwork +import com.stslex.wizard.core.network.api.clients.film.model.FilmTrailerNetwork +import com.stslex.wizard.core.network.api.clients.film.model.MovieNetwork +import com.stslex.wizard.core.network.api.clients.film.model.toNetwork class FilmClientImpl( private val client: NetworkClient, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/MockFilmClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/MockFilmClientImpl.kt similarity index 94% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/MockFilmClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/MockFilmClientImpl.kt index 9c48c2c..104c49e 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/client/MockFilmClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/client/MockFilmClientImpl.kt @@ -1,11 +1,11 @@ -package com.stslex.wizard.core.network.clients.film.client +package com.stslex.wizard.core.network.api.clients.film.client import com.stslex.wizard.core.core.Logger import com.stslex.wizard.core.core.randomUuid -import com.stslex.wizard.core.network.clients.film.model.FilmItemNetwork -import com.stslex.wizard.core.network.clients.film.model.FilmListNetwork -import com.stslex.wizard.core.network.clients.film.model.FilmTrailerNetwork -import com.stslex.wizard.core.network.clients.film.model.MovieNetwork +import com.stslex.wizard.core.network.api.clients.film.model.FilmItemNetwork +import com.stslex.wizard.core.network.api.clients.film.model.FilmListNetwork +import com.stslex.wizard.core.network.api.clients.film.model.FilmTrailerNetwork +import com.stslex.wizard.core.network.api.clients.film.model.MovieNetwork import kotlinx.coroutines.delay import kotlin.coroutines.coroutineContext import kotlin.random.Random diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmItemNetwork.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmItemNetwork.kt similarity index 82% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmItemNetwork.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmItemNetwork.kt index 9f7598b..f9ba174 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmItemNetwork.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmItemNetwork.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.film.model +package com.stslex.wizard.core.network.api.clients.film.model data class FilmItemNetwork( val id: String, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmListNetwork.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmListNetwork.kt similarity index 60% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmListNetwork.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmListNetwork.kt index 7d6a287..b3e6d42 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmListNetwork.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmListNetwork.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.film.model +package com.stslex.wizard.core.network.api.clients.film.model data class FilmListNetwork( val results: List, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmNetworkMapper.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmNetworkMapper.kt similarity index 62% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmNetworkMapper.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmNetworkMapper.kt index 5d78079..4f68c2b 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmNetworkMapper.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmNetworkMapper.kt @@ -1,10 +1,10 @@ -package com.stslex.wizard.core.network.clients.film.model +package com.stslex.wizard.core.network.api.clients.film.model -import com.stslex.wizard.core.network.api.kinopoisk.model.network.FilmItemKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.FilmListKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.MovieKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.TrailerItemKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.TrailerKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.FilmItemKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.FilmListKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.MovieKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.TrailerItemKinopoisk +import com.stslex.wizard.core.network.api.api.kinopoisk.model.network.TrailerKinopoisk fun FilmListKinopoisk.toNetwork() = FilmListNetwork( results = items.map { it.toNetwork() }, @@ -24,12 +24,11 @@ fun FilmItemKinopoisk.toNetwork() = FilmItemNetwork( fun TrailerKinopoisk.toNetwork(): List = this.items.map { it.toNetwork() } -fun TrailerItemKinopoisk.toNetwork() = - com.stslex.wizard.core.network.clients.film.model.FilmTrailerNetwork( - url = url, - name = name, - site = site, - ) +fun TrailerItemKinopoisk.toNetwork() = FilmTrailerNetwork( + url = url, + name = name, + site = site, +) fun MovieKinopoisk.toNetwork() = MovieNetwork( diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmTrailerNetwork.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmTrailerNetwork.kt similarity index 63% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmTrailerNetwork.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmTrailerNetwork.kt index e0c4e39..7c41a64 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/FilmTrailerNetwork.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/FilmTrailerNetwork.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.film.model +package com.stslex.wizard.core.network.api.clients.film.model data class FilmTrailerNetwork( val url: String, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/MovieNetwork.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/MovieNetwork.kt similarity index 82% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/MovieNetwork.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/MovieNetwork.kt index 056cdc7..68b79ff 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/MovieNetwork.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/MovieNetwork.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.film.model +package com.stslex.wizard.core.network.api.clients.film.model data class MovieNetwork( val id: String, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/TrailerSiteType.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/TrailerSiteType.kt similarity index 84% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/TrailerSiteType.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/TrailerSiteType.kt index 2b44d35..2fb7e55 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/film/model/TrailerSiteType.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/film/model/TrailerSiteType.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.film.model +package com.stslex.wizard.core.network.api.clients.film.model enum class TrailerSiteType(val value: String) { YOUTUBE("YOUTUBE"), diff --git a/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MatchClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MatchClient.kt new file mode 100644 index 0000000..32a4a47 --- /dev/null +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MatchClient.kt @@ -0,0 +1,16 @@ +package com.stslex.wizard.core.network.api.clients.match.client + +import com.stslex.wizard.core.core.paging.PagingResponse +import com.stslex.wizard.core.network.api.clients.match.model.request.MatchCreateRequest +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchDetailResponse +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchResponse +import com.stslex.wizard.core.network.api.model.PagingRequest + +interface MatchClient { + + suspend fun getMatches(request: PagingRequest): PagingResponse + + suspend fun getMatch(matchUuid: String): MatchDetailResponse + + suspend fun createMatch(request: MatchCreateRequest): MatchDetailResponse +} diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MatchClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MatchClientImpl.kt similarity index 57% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MatchClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MatchClientImpl.kt index ba8d22c..3ab35cf 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MatchClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MatchClientImpl.kt @@ -1,14 +1,14 @@ -package com.stslex.wizard.core.network.clients.match.client +package com.stslex.wizard.core.network.api.clients.match.client import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.network.api.base.get -import com.stslex.wizard.core.network.api.base.post -import com.stslex.wizard.core.network.api.base.requestPaging -import com.stslex.wizard.core.network.api.server.client.ServerApiClient -import com.stslex.wizard.core.network.clients.match.model.request.MatchCreateRequest -import com.stslex.wizard.core.network.clients.match.model.response.MatchDetailResponse -import com.stslex.wizard.core.network.clients.match.model.response.MatchResponse -import com.stslex.wizard.core.network.model.PagingRequest +import com.stslex.wizard.core.network.api.api.base.get +import com.stslex.wizard.core.network.api.api.base.post +import com.stslex.wizard.core.network.api.api.base.requestPaging +import com.stslex.wizard.core.network.api.api.server.client.ServerApiClient +import com.stslex.wizard.core.network.api.clients.match.model.request.MatchCreateRequest +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchDetailResponse +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchResponse +import com.stslex.wizard.core.network.api.model.PagingRequest import io.ktor.client.request.parameter import io.ktor.client.request.setBody diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MockMatchClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MockMatchClientImpl.kt similarity index 82% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MockMatchClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MockMatchClientImpl.kt index b12d00e..e40b712 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MockMatchClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/client/MockMatchClientImpl.kt @@ -1,12 +1,12 @@ -package com.stslex.wizard.core.network.clients.match.client +package com.stslex.wizard.core.network.api.clients.match.client import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.network.clients.match.model.request.MatchCreateRequest -import com.stslex.wizard.core.network.clients.match.model.response.MatchDetailResponse -import com.stslex.wizard.core.network.clients.match.model.response.MatchResponse -import com.stslex.wizard.core.network.clients.match.model.response.MatchStatusResponse -import com.stslex.wizard.core.network.clients.match.model.response.MatchUserResponse -import com.stslex.wizard.core.network.model.PagingRequest +import com.stslex.wizard.core.network.api.clients.match.model.request.MatchCreateRequest +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchDetailResponse +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchResponse +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchStatusResponse +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchUserResponse +import com.stslex.wizard.core.network.api.model.PagingRequest import kotlinx.coroutines.delay import kotlinx.datetime.Clock diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/request/MatchCreateRequest.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/request/MatchCreateRequest.kt similarity index 85% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/request/MatchCreateRequest.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/request/MatchCreateRequest.kt index 30e78d5..4e2872f 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/request/MatchCreateRequest.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/request/MatchCreateRequest.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.match.model.request +package com.stslex.wizard.core.network.api.clients.match.model.request import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchDetailResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchDetailResponse.kt similarity index 91% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchDetailResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchDetailResponse.kt index ac39004..df55667 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchDetailResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchDetailResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.match.model.response +package com.stslex.wizard.core.network.api.clients.match.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchResponse.kt similarity index 90% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchResponse.kt index 3feeaa8..54c52dd 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.match.model.response +package com.stslex.wizard.core.network.api.clients.match.model.response import com.stslex.wizard.core.core.paging.PagingCoreItem import kotlinx.serialization.SerialName diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchStatusResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchStatusResponse.kt similarity index 82% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchStatusResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchStatusResponse.kt index 656d91e..e6282eb 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchStatusResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchStatusResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.match.model.response +package com.stslex.wizard.core.network.api.clients.match.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchUserResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchUserResponse.kt similarity index 84% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchUserResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchUserResponse.kt index d3521e4..a84aae7 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/model/response/MatchUserResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/match/model/response/MatchUserResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.match.model.response +package com.stslex.wizard.core.network.api.clients.match.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/MockProfileClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/MockProfileClientImpl.kt similarity index 87% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/MockProfileClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/MockProfileClientImpl.kt index 2501241..d43fc57 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/MockProfileClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/MockProfileClientImpl.kt @@ -1,13 +1,13 @@ -package com.stslex.wizard.core.network.clients.profile.client +package com.stslex.wizard.core.network.api.clients.profile.client import com.stslex.wizard.core.core.Logger import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.network.clients.profile.model.request.PagingProfileRequest -import com.stslex.wizard.core.network.clients.profile.model.response.BooleanResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserFavouriteResultResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserFollowerResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserSearchResponse +import com.stslex.wizard.core.network.api.clients.profile.model.request.PagingProfileRequest +import com.stslex.wizard.core.network.api.clients.profile.model.response.BooleanResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserFavouriteResultResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserFollowerResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserSearchResponse import kotlinx.coroutines.delay class MockProfileClientImpl : ProfileClient { diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/ProfileClient.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/ProfileClient.kt similarity index 55% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/ProfileClient.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/ProfileClient.kt index 20b0791..3add4a3 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/ProfileClient.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/ProfileClient.kt @@ -1,12 +1,12 @@ -package com.stslex.wizard.core.network.clients.profile.client +package com.stslex.wizard.core.network.api.clients.profile.client import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.network.clients.profile.model.request.PagingProfileRequest -import com.stslex.wizard.core.network.clients.profile.model.response.BooleanResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserFavouriteResultResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserFollowerResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserSearchResponse +import com.stslex.wizard.core.network.api.clients.profile.model.request.PagingProfileRequest +import com.stslex.wizard.core.network.api.clients.profile.model.response.BooleanResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserFavouriteResultResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserFollowerResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserSearchResponse interface ProfileClient { diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/ProfileClientImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/ProfileClientImpl.kt similarity index 71% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/ProfileClientImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/ProfileClientImpl.kt index 0647526..353d760 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/client/ProfileClientImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/client/ProfileClientImpl.kt @@ -1,18 +1,18 @@ -package com.stslex.wizard.core.network.clients.profile.client +package com.stslex.wizard.core.network.api.clients.profile.client import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.network.api.base.NetworkClient.Companion.PARAMETER_PAGE -import com.stslex.wizard.core.network.api.base.NetworkClient.Companion.PARAMETER_PAGE_SIZE -import com.stslex.wizard.core.network.api.base.NetworkClient.Companion.PARAMETER_QUERY -import com.stslex.wizard.core.network.api.base.NetworkClient.Companion.PARAMETER_UUID -import com.stslex.wizard.core.network.api.server.client.ServerApiClient -import com.stslex.wizard.core.network.clients.profile.model.request.AddLikeRequest -import com.stslex.wizard.core.network.clients.profile.model.request.PagingProfileRequest -import com.stslex.wizard.core.network.clients.profile.model.response.BooleanResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserFavouriteResultResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserFollowerResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserResponse -import com.stslex.wizard.core.network.clients.profile.model.response.UserSearchResponse +import com.stslex.wizard.core.network.api.api.base.NetworkClient.Companion.PARAMETER_PAGE +import com.stslex.wizard.core.network.api.api.base.NetworkClient.Companion.PARAMETER_PAGE_SIZE +import com.stslex.wizard.core.network.api.api.base.NetworkClient.Companion.PARAMETER_QUERY +import com.stslex.wizard.core.network.api.api.base.NetworkClient.Companion.PARAMETER_UUID +import com.stslex.wizard.core.network.api.api.server.client.ServerApiClient +import com.stslex.wizard.core.network.api.clients.profile.model.request.AddLikeRequest +import com.stslex.wizard.core.network.api.clients.profile.model.request.PagingProfileRequest +import com.stslex.wizard.core.network.api.clients.profile.model.response.BooleanResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserFavouriteResultResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserFollowerResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserSearchResponse import io.ktor.client.call.body import io.ktor.client.request.HttpRequestBuilder import io.ktor.client.request.delete diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/request/AddLikeRequest.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/request/AddLikeRequest.kt similarity index 76% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/request/AddLikeRequest.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/request/AddLikeRequest.kt index db863cb..a066a41 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/request/AddLikeRequest.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/request/AddLikeRequest.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.profile.model.request +package com.stslex.wizard.core.network.api.clients.profile.model.request import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/request/PagingProfileRequest.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/request/PagingProfileRequest.kt similarity index 65% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/request/PagingProfileRequest.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/request/PagingProfileRequest.kt index 51d97dc..99fe8fe 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/request/PagingProfileRequest.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/request/PagingProfileRequest.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.profile.model.request +package com.stslex.wizard.core.network.api.clients.profile.model.request data class PagingProfileRequest( val query: String = "", diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/BooleanResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/BooleanResponse.kt similarity index 70% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/BooleanResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/BooleanResponse.kt index 843c322..bb2f889 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/BooleanResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/BooleanResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.profile.model.response +package com.stslex.wizard.core.network.api.clients.profile.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserFavouriteResultResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserFavouriteResultResponse.kt similarity index 83% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserFavouriteResultResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserFavouriteResultResponse.kt index 8e415bb..e7883b5 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserFavouriteResultResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserFavouriteResultResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.profile.model.response +package com.stslex.wizard.core.network.api.clients.profile.model.response import com.stslex.wizard.core.core.paging.PagingCoreItem import kotlinx.serialization.SerialName diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserFollowerResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserFollowerResponse.kt similarity index 85% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserFollowerResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserFollowerResponse.kt index ef6c36a..df691b7 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserFollowerResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserFollowerResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.profile.model.response +package com.stslex.wizard.core.network.api.clients.profile.model.response import com.stslex.wizard.core.core.paging.PagingCoreItem import kotlinx.serialization.SerialName diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserResponse.kt similarity index 91% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserResponse.kt index 7840bb5..b77ef3c 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.profile.model.response +package com.stslex.wizard.core.network.api.clients.profile.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserSearchResponse.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserSearchResponse.kt similarity index 72% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserSearchResponse.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserSearchResponse.kt index b798d95..f6a8557 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/profile/model/response/UserSearchResponse.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/clients/profile/model/response/UserSearchResponse.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.clients.profile.model.response +package com.stslex.wizard.core.network.api.clients.profile.model.response import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/di/ModuleCoreNetworkApi.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/di/ModuleCoreNetworkApi.kt new file mode 100644 index 0000000..86da334 --- /dev/null +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/di/ModuleCoreNetworkApi.kt @@ -0,0 +1,61 @@ +package com.stslex.wizard.core.network.api.di + +import com.stslex.wizard.core.core.AppModule +import com.stslex.wizard.core.network.api.api.kinopoisk.api.KinopoiskApiClient +import com.stslex.wizard.core.network.api.api.kinopoisk.api.KinopoiskApiClientImpl +import com.stslex.wizard.core.network.api.api.kinopoisk.source.KinopoiskNetworkClient +import com.stslex.wizard.core.network.api.api.kinopoisk.source.KinopoiskNetworkClientImpl +import com.stslex.wizard.core.network.api.api.server.client.ServerApiClient +import com.stslex.wizard.core.network.api.api.server.client.ServerApiClientImpl +import com.stslex.wizard.core.network.api.api.server.error_handler.ErrorHandler +import com.stslex.wizard.core.network.api.api.server.error_handler.ErrorHandlerImpl +import com.stslex.wizard.core.network.api.api.server.http_client.ServerHttpClient +import com.stslex.wizard.core.network.api.api.server.http_client.ServerHttpClientImpl +import com.stslex.wizard.core.network.api.clients.auth.client.AuthClient +import com.stslex.wizard.core.network.api.clients.auth.client.AuthClientImpl +import com.stslex.wizard.core.network.api.clients.film.client.FilmClient +import com.stslex.wizard.core.network.api.clients.film.client.MockFilmClientImpl +import com.stslex.wizard.core.network.api.clients.match.client.MatchClient +import com.stslex.wizard.core.network.api.clients.match.client.MockMatchClientImpl +import com.stslex.wizard.core.network.api.clients.profile.client.ProfileClient +import com.stslex.wizard.core.network.api.clients.profile.client.ProfileClientImpl +import com.stslex.wizard.core.network.api.utils.token.AuthController +import com.stslex.wizard.core.network.api.utils.token.AuthControllerImpl +import org.koin.core.annotation.Module +import org.koin.core.module.dsl.bind +import org.koin.core.module.dsl.singleOf +import org.koin.dsl.ModuleDeclaration + +@Module +class ModuleCoreNetworkApi : AppModule() { + + override fun declaration(): ModuleDeclaration = { + + /*Clients*/ + single { + ErrorHandlerImpl( + client = lazy { get() }, + tokenProvider = get() + ) + } + singleOf(::ServerHttpClientImpl) { bind() } + + /*Kinopoisk Api*/ + singleOf(::KinopoiskApiClientImpl) { bind() } + singleOf(::KinopoiskNetworkClientImpl) { bind() } + + /*Server Api*/ + singleOf(::ServerApiClientImpl) { bind() } + + /*Clients*/ + singleOf(::AuthClientImpl) { bind() } + singleOf(::MockFilmClientImpl) { bind() } + // todo remove mock +// singleOf(::FilmClientImpl) { bind() } + singleOf(::ProfileClientImpl) { bind() } + singleOf(::MockMatchClientImpl) { bind() } + + /*Utils*/ + singleOf(::AuthControllerImpl) { bind() } + } +} diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/model/PagingRequest.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/model/PagingRequest.kt similarity index 71% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/model/PagingRequest.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/model/PagingRequest.kt index 948d3f4..b8904ca 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/model/PagingRequest.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/model/PagingRequest.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.model +package com.stslex.wizard.core.network.api.model data class PagingRequest( val uuid: String, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/AuthController.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/AuthController.kt similarity index 82% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/AuthController.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/AuthController.kt index 3350ded..d4ac332 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/AuthController.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/AuthController.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.utils.token +package com.stslex.wizard.core.network.api.utils.token import kotlinx.coroutines.flow.StateFlow diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/AuthControllerImpl.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/AuthControllerImpl.kt similarity index 96% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/AuthControllerImpl.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/AuthControllerImpl.kt index d3bc650..84c90eb 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/AuthControllerImpl.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/AuthControllerImpl.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.utils.token +package com.stslex.wizard.core.network.api.utils.token import com.stslex.wizard.core.core.Logger import com.stslex.wizard.core.database.store.UserStore diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/TokenModel.kt b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/TokenModel.kt similarity index 67% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/TokenModel.kt rename to core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/TokenModel.kt index 931bdbe..f065aaa 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/token/TokenModel.kt +++ b/core/network/api/src/commonMain/kotlin/com/stslex/wizard/core/network/api/utils/token/TokenModel.kt @@ -1,7 +1,7 @@ -package com.stslex.wizard.core.network.utils.token +package com.stslex.wizard.core.network.api.utils.token -import com.stslex.wizard.core.network.api.server.model.TokenResponseModel -import com.stslex.wizard.core.network.clients.auth.response.LoginOkResponse +import com.stslex.wizard.core.network.api.api.server.model.TokenResponseModel +import com.stslex.wizard.core.network.api.clients.auth.response.LoginOkResponse data class TokenModel( val uuid: String, diff --git a/core/network/client/build.gradle.kts b/core/network/client/build.gradle.kts new file mode 100644 index 0000000..86149ae --- /dev/null +++ b/core/network/client/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + alias(libs.plugins.convention.kmp.library) +} + +kotlin { + sourceSets { + commonMain.dependencies { + implementation(project(":core:core")) + implementation(libs.bundles.ktor) + implementation(libs.slf4j.simple) + } + } +} diff --git a/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/AppHttpClient.kt b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/AppHttpClient.kt new file mode 100644 index 0000000..3d0fe9d --- /dev/null +++ b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/AppHttpClient.kt @@ -0,0 +1,14 @@ +package com.stslex.wizard.core.network.client + +import com.stslex.wizard.core.network.client.NetworkClientBuilder.setupLogging +import com.stslex.wizard.core.network.client.NetworkClientBuilder.setupNegotiation +import io.ktor.client.HttpClient +import io.ktor.client.engine.cio.CIO + +internal object AppHttpClient { + + val HttpClient: HttpClient = HttpClient(CIO) { + setupNegotiation() + setupLogging() + } +} \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/model/DefaultRequest.kt b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/DefaultRequest.kt similarity index 81% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/model/DefaultRequest.kt rename to core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/DefaultRequest.kt index 311836e..88fd1b4 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/model/DefaultRequest.kt +++ b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/DefaultRequest.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.base.model +package com.stslex.wizard.core.network.client data class DefaultRequest( val hostUrl: String, diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/KtorLogger.kt b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/KtorLogger.kt similarity index 84% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/KtorLogger.kt rename to core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/KtorLogger.kt index ce55be9..a58ba49 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/KtorLogger.kt +++ b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/KtorLogger.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.utils +package com.stslex.wizard.core.network.client import io.ktor.client.plugins.logging.Logger import com.stslex.wizard.core.core.Logger as Log diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/NetworkClientBuilder.kt b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/NetworkClientBuilder.kt similarity index 83% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/NetworkClientBuilder.kt rename to core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/NetworkClientBuilder.kt index d0fb07d..7975278 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/base/NetworkClientBuilder.kt +++ b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/NetworkClientBuilder.kt @@ -1,7 +1,5 @@ -package com.stslex.wizard.core.network.api.base +package com.stslex.wizard.core.network.client -import com.stslex.wizard.core.network.api.base.model.DefaultRequest -import com.stslex.wizard.core.network.utils.KtorLogger import io.ktor.client.HttpClientConfig import io.ktor.client.engine.cio.CIOEngineConfig import io.ktor.client.plugins.contentnegotiation.ContentNegotiation @@ -13,7 +11,7 @@ import io.ktor.http.URLProtocol import io.ktor.serialization.kotlinx.json.json import kotlinx.serialization.json.Json -internal object NetworkClientBuilder { +object NetworkClientBuilder { fun HttpClientConfig.setupNegotiation() { install(ContentNegotiation) { @@ -28,7 +26,7 @@ internal object NetworkClientBuilder { } } - fun HttpClientConfig.setupDefaultRequest( + fun HttpClientConfig<*>.setupDefaultRequest( defaultRequest: DefaultRequest ) { defaultRequest { diff --git a/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/di/ModuleCoreNetworkClient.kt b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/di/ModuleCoreNetworkClient.kt new file mode 100644 index 0000000..011dd7a --- /dev/null +++ b/core/network/client/src/commonMain/kotlin/com/stslex/wizard/core/network/client/di/ModuleCoreNetworkClient.kt @@ -0,0 +1,15 @@ +package com.stslex.wizard.core.network.client.di + +import com.stslex.wizard.core.core.AppModule +import com.stslex.wizard.core.network.client.AppHttpClient +import io.ktor.client.HttpClient +import org.koin.core.annotation.Module +import org.koin.dsl.ModuleDeclaration + +@Module +class ModuleCoreNetworkClient : AppModule() { + + override fun declaration(): ModuleDeclaration = { + single { AppHttpClient.HttpClient } + } +} \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/api/KinopoiskApiClient.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/api/KinopoiskApiClient.kt deleted file mode 100644 index aa3b3cc..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/api/KinopoiskApiClient.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.stslex.wizard.core.network.api.kinopoisk.api - -import com.stslex.wizard.core.network.api.base.NetworkClient - -interface KinopoiskApiClient : NetworkClient diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/api/KinopoiskApiClientImpl.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/api/KinopoiskApiClientImpl.kt deleted file mode 100644 index fa1754a..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/api/KinopoiskApiClientImpl.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.stslex.wizard.core.network.api.kinopoisk.api - -import Wizard.core.network.BuildConfig -import com.stslex.wizard.core.core.AppDispatcher -import com.stslex.wizard.core.network.api.base.BaseNetworkClient -import com.stslex.wizard.core.network.api.base.model.DefaultRequest - -class KinopoiskApiClientImpl( - appDispatcher: AppDispatcher -) : KinopoiskApiClient, BaseNetworkClient( - appDispatcher = appDispatcher, - defaultRequest = DEFAULT_REQUEST -) { - - companion object { - // TODO parse error - private const val KINOPOISK_HOST_URL = "kinopoiskapiunofficial.tech/api/v2.2" - private const val API_KEY = BuildConfig.KINOPOISK_API_KEY - private const val API_HEADER = "X-API-KEY" - private const val CONTENT_TYPE = "Content-Type" - private const val CONTENT_TYPE_VALUE = "application/json" - - private val DEFAULT_REQUEST = DefaultRequest( - hostUrl = KINOPOISK_HOST_URL, - headers = mapOf( - API_HEADER to API_KEY, - CONTENT_TYPE to CONTENT_TYPE_VALUE - ) - ) - } -} \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/NetworkApiKinopoiskMapper.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/NetworkApiKinopoiskMapper.kt deleted file mode 100644 index bf3c1b8..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/NetworkApiKinopoiskMapper.kt +++ /dev/null @@ -1,99 +0,0 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model - -import com.stslex.wizard.core.network.api.kinopoisk.model.network.FilmItemKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.FilmListKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.FilmProductionStatusNetwork -import com.stslex.wizard.core.network.api.kinopoisk.model.network.FilmTypeNetwork -import com.stslex.wizard.core.network.api.kinopoisk.model.network.MovieKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.TrailerItemKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.TrailerKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.response.FilmItemResponse -import com.stslex.wizard.core.network.api.kinopoisk.model.response.FilmListResponse -import com.stslex.wizard.core.network.api.kinopoisk.model.response.MovieResponse -import com.stslex.wizard.core.network.api.kinopoisk.model.response.TrailerItemResponse -import com.stslex.wizard.core.network.api.kinopoisk.model.response.TrailerResponse -import com.stslex.wizard.core.network.clients.film.model.TrailerSiteType - -fun FilmListResponse.toNetwork(): FilmListKinopoisk = - FilmListKinopoisk( - total = total ?: 0, - totalPages = totalPages ?: 0, - items = items?.map { it.toNetwork() }.orEmpty() - ) - -fun FilmItemResponse.toNetwork(): FilmItemKinopoisk = FilmItemKinopoisk( - kinopoiskId = kinopoiskId, - imdbId = imdbId.orEmpty(), - nameRu = nameRu.orEmpty(), - nameEn = nameEn.orEmpty(), - nameOriginal = nameOriginal.orEmpty(), - countries = countries?.map { it.country }.orEmpty(), - genres = genres?.map { it.genre }.orEmpty(), - ratingKinopoisk = ratingKinopoisk, - ratingImdb = ratingImdb, - year = year, - posterUrl = posterUrl.orEmpty(), - posterUrlPreview = posterUrlPreview.orEmpty(), - type = FilmTypeNetwork.getType(type.orEmpty()) -) - -fun TrailerResponse.toNetwork(): TrailerKinopoisk = - TrailerKinopoisk( - total = total ?: 0, - items = items?.map { it.toNetwork() }.orEmpty() - ) - -fun TrailerItemResponse.toNetwork(): TrailerItemKinopoisk = TrailerItemKinopoisk( - url = url.orEmpty(), - name = name.orEmpty(), - site = TrailerSiteType.getByValue(site.orEmpty()), -) - -fun MovieResponse.toNetwork(): MovieKinopoisk = - MovieKinopoisk( - kinopoiskId = kinopoiskId, - kinopoiskHDId = kinopoiskHDId.orEmpty(), - imdbId = imdbId.orEmpty(), - nameRu = nameRu.orEmpty(), - nameEn = nameEn.orEmpty(), - nameOriginal = nameOriginal.orEmpty(), - posterUrl = posterUrl.orEmpty(), - posterUrlPreview = posterUrlPreview.orEmpty(), - coverUrl = coverUrl.orEmpty(), - logoUrl = logoUrl.orEmpty(), - reviewsCount = reviewsCount, - ratingGoodReview = ratingGoodReview, - ratingGoodReviewVoteCount = ratingGoodReviewVoteCount, - ratingKinopoisk = ratingKinopoisk, - ratingKinopoiskVoteCount = ratingKinopoiskVoteCount, - ratingImdb = ratingImdb, - ratingImdbVoteCount = ratingImdbVoteCount, - ratingFilmCritics = ratingFilmCritics, - ratingFilmCriticsVoteCount = ratingFilmCriticsVoteCount, - ratingAwait = ratingAwait, - ratingAwaitCount = ratingAwaitCount, - ratingRfCritics = ratingRfCritics, - ratingRfCriticsVoteCount = ratingRfCriticsVoteCount, - webUrl = webUrl.orEmpty(), - year = year, - filmLength = filmLength, - slogan = slogan.orEmpty(), - description = description, - shortDescription = shortDescription.orEmpty(), - editorAnnotation = editorAnnotation.orEmpty(), - isTicketsAvailable = isTicketsAvailable ?: false, - productionStatus = FilmProductionStatusNetwork.getType(productionStatus.orEmpty()), - type = type, - ratingMpaa = ratingMpaa, - ratingAgeLimits = ratingAgeLimits, - hasImax = hasImax ?: false, - has3D = has3D ?: false, - lastSync = lastSync, - countries = countries?.map { it.country }.orEmpty(), - genres = genres?.map { it.genre }.orEmpty(), - startYear = startYear, - endYear = endYear, - isSerial = serial ?: false, - isShortFilm = shortFilm ?: false, - isCompleted = completed ?: false - ) \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/TrailerItemKinopoisk.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/TrailerItemKinopoisk.kt deleted file mode 100644 index 1974a93..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/model/network/TrailerItemKinopoisk.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.stslex.wizard.core.network.api.kinopoisk.model.network - -import com.stslex.wizard.core.network.clients.film.model.TrailerSiteType - -data class TrailerItemKinopoisk( - val url: String, - val name: String, - val site: TrailerSiteType -) \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/source/KinopoiskNetworkClient.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/source/KinopoiskNetworkClient.kt deleted file mode 100644 index 45bc6c5..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/kinopoisk/source/KinopoiskNetworkClient.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.stslex.wizard.core.network.api.kinopoisk.source - -import com.stslex.wizard.core.network.api.kinopoisk.model.network.FilmListKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.MovieKinopoisk -import com.stslex.wizard.core.network.api.kinopoisk.model.network.TrailerKinopoisk - -interface KinopoiskNetworkClient { - - suspend fun getFilms(page: Int): FilmListKinopoisk - - suspend fun getFilm(id: String): MovieKinopoisk - - suspend fun getFilmTrailers(id: String): TrailerKinopoisk -} diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/client/ServerApiClient.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/client/ServerApiClient.kt deleted file mode 100644 index d112253..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/client/ServerApiClient.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.stslex.wizard.core.network.api.server.client - -import com.stslex.wizard.core.network.api.base.NetworkClient - -interface ServerApiClient : NetworkClient diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MatchClient.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MatchClient.kt deleted file mode 100644 index 3e4adda..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MatchClient.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.stslex.wizard.core.network.clients.match.client - -import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.network.clients.match.model.request.MatchCreateRequest -import com.stslex.wizard.core.network.clients.match.model.response.MatchDetailResponse -import com.stslex.wizard.core.network.clients.match.model.response.MatchResponse -import com.stslex.wizard.core.network.model.PagingRequest - -interface MatchClient { - - suspend fun getMatches(request: PagingRequest): PagingResponse - - suspend fun getMatch(matchUuid: String): MatchDetailResponse - - suspend fun createMatch(request: MatchCreateRequest): MatchDetailResponse -} diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/di/ModuleCoreNetwork.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/di/ModuleCoreNetwork.kt deleted file mode 100644 index 48df826..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/di/ModuleCoreNetwork.kt +++ /dev/null @@ -1,56 +0,0 @@ -package com.stslex.wizard.core.network.di - -import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.network.api.kinopoisk.api.KinopoiskApiClient -import com.stslex.wizard.core.network.api.kinopoisk.api.KinopoiskApiClientImpl -import com.stslex.wizard.core.network.api.kinopoisk.source.KinopoiskNetworkClient -import com.stslex.wizard.core.network.api.kinopoisk.source.KinopoiskNetworkClientImpl -import com.stslex.wizard.core.network.api.server.client.ServerApiClient -import com.stslex.wizard.core.network.api.server.client.ServerApiClientImpl -import com.stslex.wizard.core.network.api.server.error_handler.ErrorHandler -import com.stslex.wizard.core.network.api.server.error_handler.ErrorHandlerImpl -import com.stslex.wizard.core.network.api.server.http_client.ServerHttpClient -import com.stslex.wizard.core.network.api.server.http_client.ServerHttpClientImpl -import com.stslex.wizard.core.network.clients.auth.client.AuthClient -import com.stslex.wizard.core.network.clients.auth.client.AuthClientImpl -import com.stslex.wizard.core.network.clients.film.client.FilmClient -import com.stslex.wizard.core.network.clients.film.client.MockFilmClientImpl -import com.stslex.wizard.core.network.clients.match.client.MatchClient -import com.stslex.wizard.core.network.clients.match.client.MockMatchClientImpl -import com.stslex.wizard.core.network.clients.profile.client.ProfileClient -import com.stslex.wizard.core.network.clients.profile.client.ProfileClientImpl -import com.stslex.wizard.core.network.utils.token.AuthController -import com.stslex.wizard.core.network.utils.token.AuthControllerImpl -import org.koin.core.annotation.Module -import org.koin.core.module.dsl.bind -import org.koin.core.module.dsl.singleOf -import org.koin.dsl.ModuleDeclaration - -@Module -class ModuleCoreNetwork : AppModule() { - - override fun declaration(): ModuleDeclaration = { - - /*Clients*/ - single { ErrorHandlerImpl(lazy { get() }, get()) } - singleOf(::ServerHttpClientImpl) { bind() } - - /*Kinopoisk Api*/ - singleOf(::KinopoiskApiClientImpl) { bind() } - singleOf(::KinopoiskNetworkClientImpl) { bind() } - - /*Server Api*/ - singleOf(::ServerApiClientImpl) { bind() } - - /*Clients*/ - singleOf(::AuthClientImpl) { bind() } - singleOf(::MockFilmClientImpl) { bind() } - // todo remove mock -// singleOf(::FilmClientImpl) { bind() } - singleOf(::ProfileClientImpl) { bind() } - singleOf(::MockMatchClientImpl) { bind() } - - /*Utils*/ - singleOf(::AuthControllerImpl) { bind() } - } -} diff --git a/core/ui/build.gradle.kts b/core/ui/image/build.gradle.kts similarity index 82% rename from core/ui/build.gradle.kts rename to core/ui/image/build.gradle.kts index ed34ed6..f67d40a 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/image/build.gradle.kts @@ -6,8 +6,7 @@ kotlin { sourceSets { commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:network")) - implementation(libs.kotlinx.datetime) + implementation(project(":core:network:client")) implementation(libs.bundles.coil) implementation(libs.bundles.ktor) implementation(libs.slf4j.simple) @@ -19,4 +18,4 @@ kotlin { api(libs.ktor.client.android) } } -} +} \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/AppImage.kt b/core/ui/image/src/commonMain/kotlin/com/stslex/wizard/core/ui/image/AppImage.kt similarity index 52% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/AppImage.kt rename to core/ui/image/src/commonMain/kotlin/com/stslex/wizard/core/ui/image/AppImage.kt index cc79474..4d0a1c6 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/AppImage.kt +++ b/core/ui/image/src/commonMain/kotlin/com/stslex/wizard/core/ui/image/AppImage.kt @@ -1,31 +1,11 @@ -package com.stslex.wizard.core.ui.base.image +package com.stslex.wizard.core.ui.image import androidx.compose.foundation.Image import androidx.compose.foundation.layout.BoxScope import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale -import coil3.ImageLoader -import coil3.compose.LocalPlatformContext import coil3.compose.rememberAsyncImagePainter -import coil3.network.ktor3.KtorNetworkFetcherFactory -import io.ktor.client.HttpClient -import io.ktor.client.engine.cio.CIO - -// todo refactor -private var imageLoader: ImageLoader? = null - -@Composable -internal fun rememberImageLoader(): ImageLoader { - val platformContext = LocalPlatformContext.current - return remember { - imageLoader ?: ImageLoader - .Builder(platformContext) - .components { add(KtorNetworkFetcherFactory(HttpClient(CIO))) } - .build() - } -} @Composable fun AppImage( @@ -36,10 +16,9 @@ fun AppImage( onLoading: @Composable (BoxScope.(Float) -> Unit)? = null, onFailure: @Composable (BoxScope.(Throwable) -> Unit)? = null, ) { - val imageLoader = rememberImageLoader() val painter = rememberAsyncImagePainter( model = url, - imageLoader = imageLoader, + imageLoader = ImageLoaderProvider.current, ) // todo add states Image( diff --git a/core/ui/image/src/commonMain/kotlin/com/stslex/wizard/core/ui/image/ImageLoaderTheme.kt b/core/ui/image/src/commonMain/kotlin/com/stslex/wizard/core/ui/image/ImageLoaderTheme.kt new file mode 100644 index 0000000..39f11d3 --- /dev/null +++ b/core/ui/image/src/commonMain/kotlin/com/stslex/wizard/core/ui/image/ImageLoaderTheme.kt @@ -0,0 +1,26 @@ +package com.stslex.wizard.core.ui.image + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.ProvidedValue +import androidx.compose.runtime.staticCompositionLocalOf +import coil3.ImageLoader +import coil3.compose.LocalPlatformContext +import coil3.network.ktor3.KtorNetworkFetcherFactory +import io.ktor.client.HttpClient +import org.koin.compose.getKoin + +internal val ImageLoaderProvider = staticCompositionLocalOf { + error("No ImageLoader provided") +} + +@Composable +internal fun createImageLoader(): ImageLoader = ImageLoader + .Builder(LocalPlatformContext.current) + .components { + add(KtorNetworkFetcherFactory(getKoin().get())) + } + .build() + +val imageProvidedValue: ProvidedValue<*> + @Composable + get() = ImageLoaderProvider provides createImageLoader() diff --git a/core/ui/kit/build.gradle.kts b/core/ui/kit/build.gradle.kts new file mode 100644 index 0000000..6fdc2fa --- /dev/null +++ b/core/ui/kit/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + alias(libs.plugins.convention.kmp.library.compose) +} + +kotlin { + sourceSets { + commonMain.dependencies { + implementation(project(":core:core")) + implementation(project(":core:ui:image")) + implementation(libs.kotlinx.datetime) + } + } +} diff --git a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.android.kt b/core/ui/kit/src/androidMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.android.kt similarity index 91% rename from core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.android.kt rename to core/ui/kit/src/androidMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.android.kt index 798572c..93f7f4e 100644 --- a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.android.kt +++ b/core/ui/kit/src/androidMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.android.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.mvi +package com.stslex.wizard.core.ui.kit.mvi import androidx.lifecycle.ViewModel import org.koin.androidx.viewmodel.dsl.viewModel diff --git a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt b/core/ui/kit/src/androidMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.android.kt similarity index 97% rename from core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt rename to core/ui/kit/src/androidMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.android.kt index 281ce92..5b0b673 100644 --- a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt +++ b/core/ui/kit/src/androidMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.android.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.viewModel +package com.stslex.wizard.core.ui.kit.viewModel import androidx.lifecycle.ViewModel import org.koin.androidx.viewmodel.dsl.viewModelOf diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Animations.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/Animations.kt similarity index 97% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Animations.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/Animations.kt index d2012e8..2c39162 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Animations.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/Animations.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base +package com.stslex.wizard.core.ui.kit.base import androidx.compose.animation.core.LinearEasing import androidx.compose.animation.core.RepeatMode @@ -25,7 +25,7 @@ import androidx.compose.ui.geometry.Offset import androidx.compose.ui.graphics.Brush import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import com.stslex.wizard.core.ui.theme.toPx +import com.stslex.wizard.core.ui.kit.theme.toPx import kotlin.math.roundToInt fun Modifier.shimmerLoadingAnimation( diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/AppError.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/AppError.kt similarity index 93% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/AppError.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/AppError.kt index f74f37e..2016a1b 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/AppError.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/AppError.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base +package com.stslex.wizard.core.ui.kit.base import androidx.compose.runtime.Stable import com.stslex.wizard.core.core.error.ErrorRefresh diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Clicker.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/Clicker.kt similarity index 96% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Clicker.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/Clicker.kt index 9c7f9ba..89e66c8 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Clicker.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/Clicker.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base +package com.stslex.wizard.core.ui.kit.base import androidx.compose.runtime.Composable import androidx.compose.runtime.remember diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/SwipeScrollConnection.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/SwipeScrollConnection.kt similarity index 97% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/SwipeScrollConnection.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/SwipeScrollConnection.kt index ff03b96..67ebdc2 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/SwipeScrollConnection.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/SwipeScrollConnection.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base +package com.stslex.wizard.core.ui.kit.base import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.SwipeableState diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/SwipeState.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/SwipeState.kt similarity index 54% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/SwipeState.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/SwipeState.kt index 0448ad4..672beb1 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/SwipeState.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/SwipeState.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base +package com.stslex.wizard.core.ui.kit.base enum class SwipeState { COLLAPSE, diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingColumn.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingColumn.kt similarity index 94% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingColumn.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingColumn.kt index 235df2f..d1c6f61 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingColumn.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingColumn.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base.paging +package com.stslex.wizard.core.ui.kit.base.paging import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth @@ -12,8 +12,8 @@ import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Modifier import com.stslex.wizard.core.core.paging.PagingCoreData.Companion.DEFAULT_APPEND_TYPE import com.stslex.wizard.core.core.paging.PagingCoreData.Companion.DEFAULT_BOTTOM_TYPE -import com.stslex.wizard.core.ui.base.DotsPrintAnimation -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.base.DotsPrintAnimation +import com.stslex.wizard.core.ui.kit.theme.AppDimension import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingConfig.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingConfig.kt similarity index 94% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingConfig.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingConfig.kt index 0e00747..34790ff 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingConfig.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingConfig.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base.paging +package com.stslex.wizard.core.ui.kit.base.paging import androidx.compose.runtime.Stable import com.stslex.wizard.core.core.paging.PagingCoreData diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingItem.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingItem.kt similarity index 86% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingItem.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingItem.kt index 95440cd..dabe4aa 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingItem.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingItem.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base.paging +package com.stslex.wizard.core.ui.kit.base.paging import androidx.compose.runtime.Stable import com.stslex.wizard.core.core.paging.PagingCoreData.Companion.DEFAULT_PAGING_TYPE diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingState.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingState.kt similarity index 96% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingState.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingState.kt index 5b92977..147ce76 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingState.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingState.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base.paging +package com.stslex.wizard.core.ui.kit.base.paging import androidx.compose.runtime.Stable import com.stslex.wizard.core.core.asyncMap diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingUiState.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingUiState.kt similarity index 94% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingUiState.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingUiState.kt index a9d671d..030a0a1 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/paging/PagingUiState.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/paging/PagingUiState.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base.paging +package com.stslex.wizard.core.ui.kit.base.paging import androidx.compose.runtime.Stable import kotlinx.collections.immutable.ImmutableList diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/subcompose/DimensionSubComposeLayout.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/subcompose/DimensionSubComposeLayout.kt similarity index 95% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/subcompose/DimensionSubComposeLayout.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/subcompose/DimensionSubComposeLayout.kt index a7fbf4c..4a28a06 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/subcompose/DimensionSubComposeLayout.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/subcompose/DimensionSubComposeLayout.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.base.subcompose +package com.stslex.wizard.core.ui.kit.base.subcompose import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier diff --git a/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/subcompose/SubComposeType.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/subcompose/SubComposeType.kt new file mode 100644 index 0000000..6325c02 --- /dev/null +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/base/subcompose/SubComposeType.kt @@ -0,0 +1,6 @@ +package com.stslex.wizard.core.ui.kit.base.subcompose + +enum class SubComposeType { + MAIN, + DEPEND +} \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/AppSnackbar.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/AppSnackbar.kt similarity index 97% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/AppSnackbar.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/AppSnackbar.kt index 956fa38..0004dce 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/AppSnackbar.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/AppSnackbar.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.components +package com.stslex.wizard.core.ui.kit.components import androidx.compose.foundation.gestures.Orientation import androidx.compose.foundation.layout.BoxScope @@ -27,8 +27,8 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.IntOffset -import com.stslex.wizard.core.ui.theme.AppDimension -import com.stslex.wizard.core.ui.theme.toPx +import com.stslex.wizard.core.ui.kit.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.toPx import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.filter import kotlin.math.roundToInt diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/AppToolbar.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/AppToolbar.kt similarity index 95% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/AppToolbar.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/AppToolbar.kt index e084868..64763df 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/AppToolbar.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/AppToolbar.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.components +package com.stslex.wizard.core.ui.kit.components import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box @@ -15,7 +15,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.AppDimension @Composable fun AppToolbar( diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/SnackbarSwipeState.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/SnackbarSwipeState.kt similarity index 60% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/SnackbarSwipeState.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/SnackbarSwipeState.kt index 7cc161f..eb71564 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/SnackbarSwipeState.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/SnackbarSwipeState.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.components +package com.stslex.wizard.core.ui.kit.components internal enum class SnackbarSwipeState { LEFT, diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/SnackbarType.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/SnackbarType.kt similarity index 95% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/SnackbarType.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/SnackbarType.kt index e23958d..f9771e8 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/components/SnackbarType.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/components/SnackbarType.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.components +package com.stslex.wizard.core.ui.kit.components import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Done diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/di/ModuleCoreUi.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/di/ModuleCoreUi.kt similarity index 57% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/di/ModuleCoreUi.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/di/ModuleCoreUi.kt index 6aea327..4db21cc 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/di/ModuleCoreUi.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/di/ModuleCoreUi.kt @@ -1,10 +1,10 @@ -package com.stslex.wizard.core.ui.di +package com.stslex.wizard.core.ui.kit.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.pager.pager.StorePagerFactory -import com.stslex.wizard.core.ui.pager.pager.StorePagerFactoryImpl -import com.stslex.wizard.core.ui.pager.paging_worker.PagingWorkerFactory -import com.stslex.wizard.core.ui.pager.paging_worker.PagingWorkerFactoryImpl +import com.stslex.wizard.core.ui.kit.pager.pager.StorePagerFactory +import com.stslex.wizard.core.ui.kit.pager.pager.StorePagerFactoryImpl +import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorkerFactory +import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorkerFactoryImpl import org.koin.core.annotation.Module import org.koin.core.module.dsl.bind import org.koin.core.module.dsl.factoryOf diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/BaseStore.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/BaseStore.kt similarity index 95% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/BaseStore.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/BaseStore.kt index 5356db6..26d104b 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/BaseStore.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/BaseStore.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.mvi +package com.stslex.wizard.core.ui.kit.mvi import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope @@ -8,9 +8,9 @@ import com.stslex.wizard.core.core.Logger import com.stslex.wizard.core.core.coroutine.AppCoroutineScope import com.stslex.wizard.core.core.coroutine.AppCoroutineScopeImpl import com.stslex.wizard.core.core.coroutineExceptionHandler -import com.stslex.wizard.core.ui.mvi.Store.Action -import com.stslex.wizard.core.ui.mvi.Store.Event -import com.stslex.wizard.core.ui.mvi.Store.State +import com.stslex.wizard.core.ui.kit.mvi.Store.Action +import com.stslex.wizard.core.ui.kit.mvi.Store.Event +import com.stslex.wizard.core.ui.kit.mvi.Store.State import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineScope diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/CommonEvents.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/CommonEvents.kt similarity index 93% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/CommonEvents.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/CommonEvents.kt index 2be89c4..db341a1 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/CommonEvents.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/CommonEvents.kt @@ -1,8 +1,8 @@ -package com.stslex.wizard.core.ui.mvi +package com.stslex.wizard.core.ui.kit.mvi import androidx.compose.material3.SnackbarDuration import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.components.SnackbarType +import com.stslex.wizard.core.ui.kit.components.SnackbarType interface CommonEvents { diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/Router.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/Router.kt similarity index 68% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/Router.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/Router.kt index 0b735c3..fc36422 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/Router.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/Router.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.mvi +package com.stslex.wizard.core.ui.kit.mvi fun interface Router { operator fun invoke(event: E) diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/Store.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/Store.kt similarity index 79% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/Store.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/Store.kt index 1496c78..6f1815c 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/Store.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/Store.kt @@ -1,8 +1,8 @@ -package com.stslex.wizard.core.ui.mvi +package com.stslex.wizard.core.ui.kit.mvi -import com.stslex.wizard.core.ui.mvi.Store.Action -import com.stslex.wizard.core.ui.mvi.Store.Event -import com.stslex.wizard.core.ui.mvi.Store.State +import com.stslex.wizard.core.ui.kit.mvi.Store.Action +import com.stslex.wizard.core.ui.kit.mvi.Store.Event +import com.stslex.wizard.core.ui.kit.mvi.Store.State import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreBean.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreBean.kt similarity index 94% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreBean.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreBean.kt index a0dd897..68b7a4e 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreBean.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreBean.kt @@ -1,6 +1,6 @@ -package com.stslex.wizard.core.ui.mvi +package com.stslex.wizard.core.ui.kit.mvi -import com.stslex.wizard.core.ui.viewModel.viewModelOf +import com.stslex.wizard.core.ui.kit.viewModel.viewModelOf import org.koin.core.definition.BeanDefinition import org.koin.core.definition.KoinDefinition import org.koin.core.module.Module diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.kt similarity index 94% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.kt index d568358..84c136c 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.mvi +package com.stslex.wizard.core.ui.kit.mvi import androidx.compose.runtime.Composable import androidx.lifecycle.ViewModel diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/mapper/PagingMapper.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/mapper/PagingMapper.kt similarity index 60% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/mapper/PagingMapper.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/mapper/PagingMapper.kt index 85b4724..aececf6 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/mapper/PagingMapper.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/mapper/PagingMapper.kt @@ -1,7 +1,7 @@ -package com.stslex.wizard.core.ui.pager.mapper +package com.stslex.wizard.core.ui.kit.pager.mapper import com.stslex.wizard.core.core.paging.PagingCoreItem -import com.stslex.wizard.core.ui.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem fun interface PagingMapper { diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePager.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePager.kt similarity index 54% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePager.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePager.kt index 5871121..ec3f0cd 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePager.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePager.kt @@ -1,9 +1,9 @@ -package com.stslex.wizard.core.ui.pager.pager +package com.stslex.wizard.core.ui.kit.pager.pager -import com.stslex.wizard.core.ui.base.paging.PagingItem -import com.stslex.wizard.core.ui.base.paging.PagingState -import com.stslex.wizard.core.ui.pager.states.PagerLoadEvents -import com.stslex.wizard.core.ui.pager.states.PagerLoadState +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.base.paging.PagingState +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadEvents +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerFactory.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerFactory.kt similarity index 66% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerFactory.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerFactory.kt index 88c432b..110c2c3 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerFactory.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerFactory.kt @@ -1,11 +1,11 @@ -package com.stslex.wizard.core.ui.pager.pager +package com.stslex.wizard.core.ui.kit.pager.pager import com.stslex.wizard.core.core.coroutine.AppCoroutineScope import com.stslex.wizard.core.core.paging.PagingCoreItem import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.ui.base.paging.PagingConfig -import com.stslex.wizard.core.ui.base.paging.PagingItem -import com.stslex.wizard.core.ui.pager.mapper.PagingMapper +import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.pager.mapper.PagingMapper interface StorePagerFactory { diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerFactoryImpl.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerFactoryImpl.kt similarity index 74% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerFactoryImpl.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerFactoryImpl.kt index abcc4af..4a54cf4 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerFactoryImpl.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerFactoryImpl.kt @@ -1,12 +1,12 @@ -package com.stslex.wizard.core.ui.pager.pager +package com.stslex.wizard.core.ui.kit.pager.pager import com.stslex.wizard.core.core.coroutine.AppCoroutineScope import com.stslex.wizard.core.core.paging.PagingCoreItem import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.ui.base.paging.PagingConfig -import com.stslex.wizard.core.ui.base.paging.PagingItem -import com.stslex.wizard.core.ui.pager.mapper.PagingMapper -import com.stslex.wizard.core.ui.pager.paging_worker.PagingWorkerFactory +import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.pager.mapper.PagingMapper +import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorkerFactory class StorePagerFactoryImpl( private val workerFactory: PagingWorkerFactory diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerImpl.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerImpl.kt similarity index 86% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerImpl.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerImpl.kt index 4426b1b..2a99553 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/pager/StorePagerImpl.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/pager/StorePagerImpl.kt @@ -1,18 +1,18 @@ -package com.stslex.wizard.core.ui.pager.pager +package com.stslex.wizard.core.ui.kit.pager.pager import com.stslex.wizard.core.core.paging.PagingCoreData.Companion.DEFAULT_PAGE import com.stslex.wizard.core.core.paging.PagingCoreItem import com.stslex.wizard.core.core.paging.PagingResponse -import com.stslex.wizard.core.ui.base.mapToAppError -import com.stslex.wizard.core.ui.base.paging.PagingConfig -import com.stslex.wizard.core.ui.base.paging.PagingItem -import com.stslex.wizard.core.ui.base.paging.PagingState -import com.stslex.wizard.core.ui.base.paging.pagingMap -import com.stslex.wizard.core.ui.pager.states.PagerLoadEvents -import com.stslex.wizard.core.ui.pager.states.PagerLoadState -import com.stslex.wizard.core.ui.pager.mapper.PagingMapper -import com.stslex.wizard.core.ui.pager.paging_worker.PagingRequestType -import com.stslex.wizard.core.ui.pager.paging_worker.PagingWorker +import com.stslex.wizard.core.ui.kit.base.mapToAppError +import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.base.paging.PagingState +import com.stslex.wizard.core.ui.kit.base.paging.pagingMap +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadEvents +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState +import com.stslex.wizard.core.ui.kit.pager.mapper.PagingMapper +import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingRequestType +import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorker import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.Job import kotlinx.coroutines.flow.MutableSharedFlow diff --git a/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingRequestType.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingRequestType.kt new file mode 100644 index 0000000..a47a32c --- /dev/null +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingRequestType.kt @@ -0,0 +1,6 @@ +package com.stslex.wizard.core.ui.kit.pager.paging_worker + +enum class PagingRequestType { + DEFAULT, + QUERY +} \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorker.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorker.kt similarity index 90% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorker.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorker.kt index 1b1d2ca..6efba68 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorker.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorker.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.pager.paging_worker +package com.stslex.wizard.core.ui.kit.pager.paging_worker import com.stslex.wizard.core.core.paging.PagingCoreItem import com.stslex.wizard.core.core.paging.PagingResponse diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerFactory.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerFactory.kt similarity index 66% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerFactory.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerFactory.kt index d1e75ec..5923923 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerFactory.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerFactory.kt @@ -1,6 +1,7 @@ -package com.stslex.wizard.core.ui.pager.paging_worker +package com.stslex.wizard.core.ui.kit.pager.paging_worker import com.stslex.wizard.core.core.coroutine.AppCoroutineScope +import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorker interface PagingWorkerFactory { diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerFactoryImpl.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerFactoryImpl.kt similarity index 88% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerFactoryImpl.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerFactoryImpl.kt index 098d05a..854b040 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerFactoryImpl.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerFactoryImpl.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.pager.paging_worker +package com.stslex.wizard.core.ui.kit.pager.paging_worker import com.stslex.wizard.core.core.coroutine.AppCoroutineScope diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerImpl.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerImpl.kt similarity index 98% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerImpl.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerImpl.kt index 6e5c480..a6735e5 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingWorkerImpl.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/paging_worker/PagingWorkerImpl.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.pager.paging_worker +package com.stslex.wizard.core.ui.kit.pager.paging_worker import com.stslex.wizard.core.core.coroutine.AppCoroutineScope import com.stslex.wizard.core.core.paging.PagingCoreItem diff --git a/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/states/PagerLoadEvents.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/states/PagerLoadEvents.kt new file mode 100644 index 0000000..d095a64 --- /dev/null +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/states/PagerLoadEvents.kt @@ -0,0 +1,8 @@ +package com.stslex.wizard.core.ui.kit.pager.states + +import com.stslex.wizard.core.ui.kit.base.AppError + +sealed interface PagerLoadEvents { + + data class Error(val error: AppError) : PagerLoadEvents +} \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/states/PagerLoadState.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/states/PagerLoadState.kt similarity index 77% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/states/PagerLoadState.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/states/PagerLoadState.kt index e54b418..e63bb56 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/states/PagerLoadState.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/pager/states/PagerLoadState.kt @@ -1,6 +1,6 @@ -package com.stslex.wizard.core.ui.pager.states +package com.stslex.wizard.core.ui.kit.pager.states -import com.stslex.wizard.core.ui.base.AppError +import com.stslex.wizard.core.ui.kit.base.AppError sealed interface PagerLoadState { diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/AppDimension.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/AppDimension.kt similarity index 92% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/AppDimension.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/AppDimension.kt index 3f6bd9c..1df38f8 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/AppDimension.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/AppDimension.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.theme +package com.stslex.wizard.core.ui.kit.theme import androidx.compose.ui.unit.dp diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/AppTheme.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/AppTheme.kt similarity index 70% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/AppTheme.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/AppTheme.kt index d2a679d..95333fb 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/AppTheme.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/AppTheme.kt @@ -1,10 +1,12 @@ -package com.stslex.wizard.core.ui.theme +package com.stslex.wizard.core.ui.kit.theme import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material3.MaterialTheme import androidx.compose.material3.darkColorScheme import androidx.compose.material3.lightColorScheme import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import com.stslex.wizard.core.ui.image.imageProvidedValue @Composable fun AppTheme( @@ -18,7 +20,11 @@ fun AppTheme( } MaterialTheme( colorScheme = colors, - content = content + content = { + CompositionLocalProvider(imageProvidedValue) { + content() + } + } ) // todo kamel migration test // CompositionLocalProvider( diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/DimenExt.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/DimenExt.kt similarity index 93% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/DimenExt.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/DimenExt.kt index a6db08f..513c27c 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/theme/DimenExt.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/theme/DimenExt.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.theme +package com.stslex.wizard.core.ui.kit.theme import androidx.compose.runtime.Composable import androidx.compose.runtime.ReadOnlyComposable diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.kt similarity index 96% rename from core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt rename to core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.kt index 26cd092..6212637 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt +++ b/core/ui/kit/src/commonMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.viewModel +package com.stslex.wizard.core.ui.kit.viewModel import androidx.lifecycle.ViewModel import org.koin.core.definition.BeanDefinition diff --git a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.ios.kt b/core/ui/kit/src/iosMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.ios.kt similarity index 91% rename from core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.ios.kt rename to core/ui/kit/src/iosMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.ios.kt index 7ec579b..9202688 100644 --- a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreExt.ios.kt +++ b/core/ui/kit/src/iosMain/kotlin/com/stslex/wizard/core/ui/kit/mvi/StoreExt.ios.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.mvi +package com.stslex.wizard.core.ui.kit.mvi import androidx.lifecycle.ViewModel import org.koin.core.definition.Definition diff --git a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt b/core/ui/kit/src/iosMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.ios.kt similarity index 97% rename from core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt rename to core/ui/kit/src/iosMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.ios.kt index c6cff7b..4bd564c 100644 --- a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt +++ b/core/ui/kit/src/iosMain/kotlin/com/stslex/wizard/core/ui/kit/viewModel/ViewModelBean.ios.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.ui.viewModel +package com.stslex.wizard.core.ui.kit.viewModel import androidx.lifecycle.ViewModel import org.koin.core.definition.BeanDefinition diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/ImageType.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/ImageType.kt deleted file mode 100644 index 3c92754..0000000 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/ImageType.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.stslex.wizard.core.ui.base.image - -enum class ImageType { - KAMEL, - NATIVE; -} diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/subcompose/SubComposeType.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/subcompose/SubComposeType.kt deleted file mode 100644 index bff560d..0000000 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/subcompose/SubComposeType.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.stslex.wizard.core.ui.base.subcompose - -enum class SubComposeType { - MAIN, - DEPEND -} \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingRequestType.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingRequestType.kt deleted file mode 100644 index 0532012..0000000 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/paging_worker/PagingRequestType.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.stslex.wizard.core.ui.pager.paging_worker - -enum class PagingRequestType { - DEFAULT, - QUERY -} \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/states/PagerLoadEvents.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/states/PagerLoadEvents.kt deleted file mode 100644 index 23f9bbc..0000000 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/pager/states/PagerLoadEvents.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.stslex.wizard.core.ui.pager.states - -import com.stslex.wizard.core.ui.base.AppError - -sealed interface PagerLoadEvents { - - data class Error(val error: AppError) : PagerLoadEvents -} \ No newline at end of file diff --git a/feature/auth/build.gradle.kts b/feature/auth/build.gradle.kts index 4c70d39..1fe2d80 100644 --- a/feature/auth/build.gradle.kts +++ b/feature/auth/build.gradle.kts @@ -6,9 +6,9 @@ kotlin { sourceSets { commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) + implementation(project(":core:ui:kit")) implementation(project(":core:navigation")) - implementation(project(":core:network")) + implementation(project(":core:network:api")) implementation(project(":core:database")) } } diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/data/AuthRepositoryImpl.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/data/AuthRepositoryImpl.kt index 79e9fbc..27a18c7 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/data/AuthRepositoryImpl.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/data/AuthRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.auth.data -import com.stslex.wizard.core.network.clients.auth.client.AuthClient +import com.stslex.wizard.core.network.api.clients.auth.client.AuthClient class AuthRepositoryImpl( private val client: AuthClient diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/di/ModuleFeatureAuth.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/di/ModuleFeatureAuth.kt index c84a3e8..dd00146 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/di/ModuleFeatureAuth.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/di/ModuleFeatureAuth.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.auth.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.auth.data.AuthRepository import com.stslex.wizard.feature.auth.data.AuthRepositoryImpl import com.stslex.wizard.feature.auth.domain.AuthInteractor diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/navigation/AuthGraph.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/navigation/AuthGraph.kt index 9eaa870..eeaf93f 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/navigation/AuthGraph.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/navigation/AuthGraph.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.auth.ui.AuthScreen import com.stslex.wizard.feature.auth.ui.model.screen.rememberAuthScreenState import com.stslex.wizard.feature.auth.ui.store.AuthStore diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/navigation/AuthRouter.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/navigation/AuthRouter.kt index db1d673..850ae95 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/navigation/AuthRouter.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/navigation/AuthRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.auth.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.auth.ui.store.AuthStore interface AuthRouter : Router \ No newline at end of file diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/AuthScreen.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/AuthScreen.kt index b556f3a..669b49e 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/AuthScreen.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/AuthScreen.kt @@ -14,9 +14,9 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.components.AppSnackbarHost -import com.stslex.wizard.core.ui.theme.AppDimension -import com.stslex.wizard.core.ui.theme.toPx +import com.stslex.wizard.core.ui.kit.components.AppSnackbarHost +import com.stslex.wizard.core.ui.kit.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.toPx import com.stslex.wizard.feature.auth.ui.components.AuthFieldsColumn import com.stslex.wizard.feature.auth.ui.components.AuthTitle import com.stslex.wizard.feature.auth.ui.model.screen.AuthScreenState diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/components/AuthFieldsColumn.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/components/AuthFieldsColumn.kt index d53011c..941cebf 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/components/AuthFieldsColumn.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/components/AuthFieldsColumn.kt @@ -20,7 +20,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.auth.ui.model.screen.AuthScreenState import com.stslex.wizard.feature.auth.ui.model.screen.text_field.LoginTextFieldState import com.stslex.wizard.feature.auth.ui.model.screen.text_field.UsernameTextFieldState diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/components/AuthTitle.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/components/AuthTitle.kt index ec6cef9..b8c3b2f 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/components/AuthTitle.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/components/AuthTitle.kt @@ -24,7 +24,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.scale import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.auth.ui.store.AuthStore.AuthFieldsState import kotlinx.coroutines.launch diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/store/AuthStore.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/store/AuthStore.kt index 74c8a1b..60f191e 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/store/AuthStore.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/store/AuthStore.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.auth.ui.store -import com.stslex.wizard.core.ui.mvi.CommonEvents -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.auth.ui.store.AuthStore.Action import com.stslex.wizard.feature.auth.ui.store.AuthStore.Event import com.stslex.wizard.feature.auth.ui.store.AuthStore.State diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/store/AuthStoreImpl.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/store/AuthStoreImpl.kt index 62063d3..dabd498 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/store/AuthStoreImpl.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/ui/store/AuthStoreImpl.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.auth.ui.store -import com.stslex.wizard.core.ui.mvi.BaseStore -import com.stslex.wizard.core.ui.mvi.CommonEvents.Snackbar +import com.stslex.wizard.core.ui.kit.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents.Snackbar import com.stslex.wizard.feature.auth.domain.AuthInteractor import com.stslex.wizard.feature.auth.navigation.AuthRouter import com.stslex.wizard.feature.auth.ui.store.AuthStore.Action diff --git a/feature/favourite/build.gradle.kts b/feature/favourite/build.gradle.kts index 856a067..42dfd8b 100644 --- a/feature/favourite/build.gradle.kts +++ b/feature/favourite/build.gradle.kts @@ -5,8 +5,8 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) - implementation(project(":core:network")) + implementation(project(":core:ui:kit")) + implementation(project(":core:network:api")) implementation(project(":core:navigation")) } } diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/data/model/FavouriteDataMapper.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/data/model/FavouriteDataMapper.kt index 92db9fd..6eaf499 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/data/model/FavouriteDataMapper.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/data/model/FavouriteDataMapper.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.favourite.data.model -import com.stslex.wizard.core.network.clients.profile.model.response.UserFavouriteResultResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserFavouriteResultResponse fun UserFavouriteResultResponse.toData() = FavouriteDataModel( uuid = uuid, diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/data/repository/FavouriteRepositoryImpl.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/data/repository/FavouriteRepositoryImpl.kt index e59b2d5..9cc920c 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/data/repository/FavouriteRepositoryImpl.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/data/repository/FavouriteRepositoryImpl.kt @@ -2,8 +2,8 @@ package com.stslex.wizard.feature.favourite.data.repository import com.stslex.wizard.core.core.paging.PagingResponse import com.stslex.wizard.core.core.paging.pagingMap -import com.stslex.wizard.core.network.clients.profile.client.ProfileClient -import com.stslex.wizard.core.network.clients.profile.model.request.PagingProfileRequest +import com.stslex.wizard.core.network.api.clients.profile.client.ProfileClient +import com.stslex.wizard.core.network.api.clients.profile.model.request.PagingProfileRequest import com.stslex.wizard.feature.favourite.data.model.FavouriteDataModel import com.stslex.wizard.feature.favourite.data.model.toData diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/di/ModuleFeatureFavourite.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/di/ModuleFeatureFavourite.kt index e3189d1..7d86b9e 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/di/ModuleFeatureFavourite.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/di/ModuleFeatureFavourite.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.favourite.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.favourite.data.repository.FavouriteRepository import com.stslex.wizard.feature.favourite.data.repository.FavouriteRepositoryImpl import com.stslex.wizard.feature.favourite.domain.interactor.FavouriteInteractor diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/navigation/FavouriteGraph.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/navigation/FavouriteGraph.kt index 7289879..11df185 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/navigation/FavouriteGraph.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/navigation/FavouriteGraph.kt @@ -7,7 +7,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.favourite.ui.FavouriteScreen import com.stslex.wizard.feature.favourite.ui.store.FavouriteStore import com.stslex.wizard.feature.favourite.ui.store.FavouriteStore.Action diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/navigation/FavouriteRouter.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/navigation/FavouriteRouter.kt index 812022b..217ff12 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/navigation/FavouriteRouter.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/navigation/FavouriteRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.favourite.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.favourite.ui.store.FavouriteStore interface FavouriteRouter : Router diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContent.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContent.kt index 873dc1e..9479699 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContent.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContent.kt @@ -9,9 +9,9 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.base.paging.PagingColumn -import com.stslex.wizard.core.ui.base.paging.PagingUiState -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.base.paging.PagingColumn +import com.stslex.wizard.core.ui.kit.base.paging.PagingUiState +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.favourite.ui.components.empty.FavouriteScreenEmpty import com.stslex.wizard.feature.favourite.ui.components.shimmer.FavouriteScreenShimmer import com.stslex.wizard.feature.favourite.ui.model.FavouriteModel diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContentItem.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContentItem.kt index 326e19a..672dff7 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContentItem.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContentItem.kt @@ -14,7 +14,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.favourite.ui.model.FavouriteModel @Composable diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContentLoading.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContentLoading.kt index 92a053e..4ee1aba 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContentLoading.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenContentLoading.kt @@ -2,7 +2,7 @@ package com.stslex.wizard.feature.favourite.ui.components.content import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.base.DotsPrintAnimation +import com.stslex.wizard.core.ui.kit.base.DotsPrintAnimation @Composable fun FavouriteScreenContentLoading( diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenSearchField.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenSearchField.kt index d3475e7..432b862 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenSearchField.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/content/FavouriteScreenSearchField.kt @@ -6,7 +6,7 @@ import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material3.TextField import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.AppDimension @Composable diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/shimmer/FavouriteScreenShimmer.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/shimmer/FavouriteScreenShimmer.kt index 232df10..8fe4cb4 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/shimmer/FavouriteScreenShimmer.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/components/shimmer/FavouriteScreenShimmer.kt @@ -14,8 +14,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.unit.dp -import com.stslex.wizard.core.ui.base.shimmerLoadingAnimation -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.base.shimmerLoadingAnimation +import com.stslex.wizard.core.ui.kit.theme.AppDimension @Composable fun FavouriteScreenShimmer( diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/model/FavouriteModel.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/model/FavouriteModel.kt index ba4d003..10d85b5 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/model/FavouriteModel.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/model/FavouriteModel.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.favourite.ui.model import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem @Stable data class FavouriteModel( diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteScreenState.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteScreenState.kt index 0dd3cee..04491e6 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteScreenState.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteScreenState.kt @@ -1,8 +1,8 @@ package com.stslex.wizard.feature.favourite.ui.store import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.base.AppError -import com.stslex.wizard.core.ui.pager.states.PagerLoadState +import com.stslex.wizard.core.ui.kit.base.AppError +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState @Stable sealed interface FavouriteScreenState { diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteStore.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteStore.kt index 3d75f05..c6637f7 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteStore.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteStore.kt @@ -1,10 +1,10 @@ package com.stslex.wizard.feature.favourite.ui.store import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.base.paging.PagingConfig -import com.stslex.wizard.core.ui.base.paging.PagingUiState -import com.stslex.wizard.core.ui.mvi.CommonEvents -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig +import com.stslex.wizard.core.ui.kit.base.paging.PagingUiState +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.favourite.ui.model.FavouriteModel import com.stslex.wizard.feature.favourite.ui.store.FavouriteStore.Action import com.stslex.wizard.feature.favourite.ui.store.FavouriteStore.Event diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteStoreImpl.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteStoreImpl.kt index 2dd2825..b68a6ea 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteStoreImpl.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/ui/store/FavouriteStoreImpl.kt @@ -1,13 +1,13 @@ package com.stslex.wizard.feature.favourite.ui.store import com.stslex.wizard.core.core.AppDispatcher -import com.stslex.wizard.core.ui.base.mapToAppError -import com.stslex.wizard.core.ui.base.paging.toUi -import com.stslex.wizard.core.ui.mvi.BaseStore -import com.stslex.wizard.core.ui.mvi.CommonEvents.Snackbar -import com.stslex.wizard.core.ui.pager.pager.StorePager -import com.stslex.wizard.core.ui.pager.pager.StorePagerFactory -import com.stslex.wizard.core.ui.pager.states.PagerLoadState +import com.stslex.wizard.core.ui.kit.base.mapToAppError +import com.stslex.wizard.core.ui.kit.base.paging.toUi +import com.stslex.wizard.core.ui.kit.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents.Snackbar +import com.stslex.wizard.core.ui.kit.pager.pager.StorePager +import com.stslex.wizard.core.ui.kit.pager.pager.StorePagerFactory +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState import com.stslex.wizard.feature.favourite.domain.interactor.FavouriteInteractor import com.stslex.wizard.feature.favourite.navigation.FavouriteRouter import com.stslex.wizard.feature.favourite.ui.model.FavouriteModel diff --git a/feature/film/build.gradle.kts b/feature/film/build.gradle.kts index 16d6fae..2d904be 100644 --- a/feature/film/build.gradle.kts +++ b/feature/film/build.gradle.kts @@ -5,8 +5,9 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) - implementation(project(":core:network")) + implementation(project(":core:ui:kit")) + implementation(project(":core:ui:image")) + implementation(project(":core:network:api")) implementation(project(":core:database")) implementation(project(":core:navigation")) } diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/data/model/FilmDataMapper.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/data/model/FilmDataMapper.kt index acf85e6..30ffe2e 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/data/model/FilmDataMapper.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/data/model/FilmDataMapper.kt @@ -1,9 +1,9 @@ package com.stslex.wizard.feature.film.data.model import com.stslex.wizard.core.database.sources.model.FilmEntity -import com.stslex.wizard.core.network.clients.film.model.FilmTrailerNetwork -import com.stslex.wizard.core.network.clients.film.model.MovieNetwork -import com.stslex.wizard.core.network.clients.film.model.TrailerSiteType +import com.stslex.wizard.core.network.api.clients.film.model.FilmTrailerNetwork +import com.stslex.wizard.core.network.api.clients.film.model.MovieNetwork +import com.stslex.wizard.core.network.api.clients.film.model.TrailerSiteType fun MovieNetwork.toData( isFavourite: Boolean, diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/data/repository/FilmRepositoryImpl.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/data/repository/FilmRepositoryImpl.kt index da03cc3..781caa8 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/data/repository/FilmRepositoryImpl.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/data/repository/FilmRepositoryImpl.kt @@ -1,8 +1,8 @@ package com.stslex.wizard.feature.film.data.repository import com.stslex.wizard.core.database.sources.source.FavouriteFilmDataSource -import com.stslex.wizard.core.network.clients.film.client.FilmClient -import com.stslex.wizard.core.network.clients.profile.client.ProfileClient +import com.stslex.wizard.core.network.api.clients.film.client.FilmClient +import com.stslex.wizard.core.network.api.clients.profile.client.ProfileClient import com.stslex.wizard.feature.film.data.model.FilmData import com.stslex.wizard.feature.film.data.model.getTrailer import com.stslex.wizard.feature.film.data.model.toData diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/di/ModuleFeatureFilm.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/di/ModuleFeatureFilm.kt index c83d316..3691820 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/di/ModuleFeatureFilm.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/di/ModuleFeatureFilm.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.film.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.film.data.repository.FilmRepository import com.stslex.wizard.feature.film.data.repository.FilmRepositoryImpl import com.stslex.wizard.feature.film.domain.interactor.FilmInteractor diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/navigation/FilmRouter.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/navigation/FilmRouter.kt index 9ab014c..0b68cc6 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/navigation/FilmRouter.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/navigation/FilmRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.film.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.film.ui.store.FilmStore interface FilmRouter : Router diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/navigation/GraphFilm.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/navigation/GraphFilm.kt index 1a775d4..d55e967 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/navigation/GraphFilm.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/navigation/GraphFilm.kt @@ -7,7 +7,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.film.ui.FilmScreen import com.stslex.wizard.feature.film.ui.store.FilmStore import com.stslex.wizard.feature.film.ui.store.FilmStore.Action diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/components/FilmContentScreen.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/components/FilmContentScreen.kt index e7a79c7..25e1fd5 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/components/FilmContentScreen.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/components/FilmContentScreen.kt @@ -51,14 +51,14 @@ import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp -import com.stslex.wizard.core.ui.base.SwipeScrollConnection -import com.stslex.wizard.core.ui.base.SwipeState -import com.stslex.wizard.core.ui.base.image.AppImage -import com.stslex.wizard.core.ui.base.onClick -import com.stslex.wizard.core.ui.base.onClickDelay -import com.stslex.wizard.core.ui.theme.AppDimension -import com.stslex.wizard.core.ui.theme.toDp -import com.stslex.wizard.core.ui.theme.toPx +import com.stslex.wizard.core.ui.kit.base.SwipeScrollConnection +import com.stslex.wizard.core.ui.kit.base.SwipeState +import com.stslex.wizard.core.ui.image.AppImage +import com.stslex.wizard.core.ui.kit.base.onClick +import com.stslex.wizard.core.ui.kit.base.onClickDelay +import com.stslex.wizard.core.ui.kit.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.toDp +import com.stslex.wizard.core.ui.kit.theme.toPx import com.stslex.wizard.feature.film.ui.model.Film @OptIn(ExperimentalMaterialApi::class) diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/store/FilmStore.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/store/FilmStore.kt index 57acd17..0820303 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/store/FilmStore.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/store/FilmStore.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.film.ui.store import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.film.ui.store.FilmStore.Action import com.stslex.wizard.feature.film.ui.store.FilmStore.Event import com.stslex.wizard.feature.film.ui.store.FilmStore.State diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/store/FilmStoreImpl.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/store/FilmStoreImpl.kt index 6ede5b3..1db0dab 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/store/FilmStoreImpl.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/store/FilmStoreImpl.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.film.ui.store -import com.stslex.wizard.core.ui.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.BaseStore import com.stslex.wizard.feature.film.domain.interactor.FilmInteractor import com.stslex.wizard.feature.film.navigation.FilmRouter import com.stslex.wizard.feature.film.ui.model.toDomain diff --git a/feature/film_feed/build.gradle.kts b/feature/film_feed/build.gradle.kts index 40365f6..2eb4885 100644 --- a/feature/film_feed/build.gradle.kts +++ b/feature/film_feed/build.gradle.kts @@ -5,8 +5,9 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) - implementation(project(":core:network")) + implementation(project(":core:ui:kit")) + implementation(project(":core:ui:image")) + implementation(project(":core:network:api")) implementation(project(":core:navigation")) } } diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/data/model/FeedDataMapper.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/data/model/FeedDataMapper.kt index 64280f0..e57fdef 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/data/model/FeedDataMapper.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/data/model/FeedDataMapper.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.film_feed.data.model -import com.stslex.wizard.core.network.clients.film.model.FilmItemNetwork -import com.stslex.wizard.core.network.clients.film.model.FilmListNetwork +import com.stslex.wizard.core.network.api.clients.film.model.FilmItemNetwork +import com.stslex.wizard.core.network.api.clients.film.model.FilmListNetwork fun FilmListNetwork.toData() = FeedDataModel( films = results.map { it.toData() }, diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/data/repository/FeedRepositoryImpl.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/data/repository/FeedRepositoryImpl.kt index 41fa793..77ae220 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/data/repository/FeedRepositoryImpl.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/data/repository/FeedRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.film_feed.data.repository -import com.stslex.wizard.core.network.clients.film.client.FilmClient +import com.stslex.wizard.core.network.api.clients.film.client.FilmClient import com.stslex.wizard.feature.film_feed.data.model.FeedDataModel import com.stslex.wizard.feature.film_feed.data.model.toData diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/di/ModuleFeatureFeed.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/di/ModuleFeatureFeed.kt index 7985237..cc6d207 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/di/ModuleFeatureFeed.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/di/ModuleFeatureFeed.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.film_feed.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.film_feed.data.repository.FeedRepository import com.stslex.wizard.feature.film_feed.data.repository.FeedRepositoryImpl import com.stslex.wizard.feature.film_feed.domain.interactor.FeedInteractor diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/navigation/FeedScreenRouter.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/navigation/FeedScreenRouter.kt index b0c42f1..ba86ba5 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/navigation/FeedScreenRouter.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/navigation/FeedScreenRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.film_feed.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.film_feed.ui.store.FeedStore.Action.Navigation interface FeedScreenRouter : Router diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/navigation/GraphFilmFeed.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/navigation/GraphFilmFeed.kt index 78a3f42..aca2047 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/navigation/GraphFilmFeed.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/navigation/GraphFilmFeed.kt @@ -7,7 +7,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.film_feed.ui.FeedScreen import com.stslex.wizard.feature.film_feed.ui.store.FeedStore import com.stslex.wizard.feature.film_feed.ui.store.FeedStore.Action diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/components/FeedScreenFilmItem.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/components/FeedScreenFilmItem.kt index 32dca61..e6c2cdb 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/components/FeedScreenFilmItem.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/components/FeedScreenFilmItem.kt @@ -23,9 +23,9 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.unit.Dp -import com.stslex.wizard.core.ui.base.image.AppImage -import com.stslex.wizard.core.ui.base.onClickDelay -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.image.AppImage +import com.stslex.wizard.core.ui.kit.base.onClickDelay +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.film_feed.ui.model.FilmModel import kotlinx.collections.immutable.ImmutableList diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/store/FeedStore.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/store/FeedStore.kt index 1c1c975..a7bfdad 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/store/FeedStore.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/store/FeedStore.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.film_feed.ui.store import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.film_feed.ui.model.FilmModel import com.stslex.wizard.feature.film_feed.ui.model.ScreenState import com.stslex.wizard.feature.film_feed.ui.store.FeedStore.Action diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/store/FeedStoreImpl.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/store/FeedStoreImpl.kt index 44f210b..51ec3c1 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/store/FeedStoreImpl.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/store/FeedStoreImpl.kt @@ -2,7 +2,7 @@ package com.stslex.wizard.feature.film_feed.ui.store import androidx.compose.runtime.Stable import com.stslex.wizard.core.core.Logger -import com.stslex.wizard.core.ui.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.BaseStore import com.stslex.wizard.feature.film_feed.domain.interactor.FeedInteractor import com.stslex.wizard.feature.film_feed.navigation.FeedScreenRouter import com.stslex.wizard.feature.film_feed.ui.model.ScreenState diff --git a/feature/follower/build.gradle.kts b/feature/follower/build.gradle.kts index d0bef21..f068ae9 100644 --- a/feature/follower/build.gradle.kts +++ b/feature/follower/build.gradle.kts @@ -5,8 +5,8 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) - implementation(project(":core:network")) + implementation(project(":core:ui:kit")) + implementation(project(":core:network:api")) implementation(project(":core:navigation")) } } \ No newline at end of file diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/data/model/FollowerDataMapper.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/data/model/FollowerDataMapper.kt index abf57d3..1f49ac8 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/data/model/FollowerDataMapper.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/data/model/FollowerDataMapper.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.follower.data.model -import com.stslex.wizard.core.network.clients.profile.model.response.UserFollowerResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserFollowerResponse fun UserFollowerResponse.toData(): FollowerDataModel = FollowerDataModel( uuid = uuid, diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/data/repository/FollowerRepositoryImpl.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/data/repository/FollowerRepositoryImpl.kt index efdcbe2..c6ce6a8 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/data/repository/FollowerRepositoryImpl.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/data/repository/FollowerRepositoryImpl.kt @@ -2,8 +2,8 @@ package com.stslex.wizard.feature.follower.data.repository import com.stslex.wizard.core.core.paging.PagingResponse import com.stslex.wizard.core.core.paging.pagingMap -import com.stslex.wizard.core.network.clients.profile.client.ProfileClient -import com.stslex.wizard.core.network.clients.profile.model.request.PagingProfileRequest +import com.stslex.wizard.core.network.api.clients.profile.client.ProfileClient +import com.stslex.wizard.core.network.api.clients.profile.model.request.PagingProfileRequest import com.stslex.wizard.feature.follower.data.model.FollowerDataModel import com.stslex.wizard.feature.follower.data.model.toData diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/di/ModuleFeatureFollower.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/di/ModuleFeatureFollower.kt index b4f72dc..e92e9e7 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/di/ModuleFeatureFollower.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/di/ModuleFeatureFollower.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.follower.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.follower.data.repository.FollowerRepository import com.stslex.wizard.feature.follower.data.repository.FollowerRepositoryImpl import com.stslex.wizard.feature.follower.domain.interactor.FollowerInteractor diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/navigation/FollowerRouter.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/navigation/FollowerRouter.kt index 1db8523..61b8454 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/navigation/FollowerRouter.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/navigation/FollowerRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.follower.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.follower.ui.store.FollowerStore.Action.Navigation interface FollowerRouter : Router diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/navigation/GraphFollower.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/navigation/GraphFollower.kt index bbe82f3..2b9aac0 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/navigation/GraphFollower.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/navigation/GraphFollower.kt @@ -7,7 +7,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.follower.ui.FollowerScreen import com.stslex.wizard.feature.follower.ui.store.FollowerStore import com.stslex.wizard.feature.follower.ui.store.FollowerStore.Action diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/FollowerScreen.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/FollowerScreen.kt index fcbb1a2..fbe15a6 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/FollowerScreen.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/FollowerScreen.kt @@ -6,7 +6,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.base.paging.PagingColumn +import com.stslex.wizard.core.ui.kit.base.paging.PagingColumn import com.stslex.wizard.feature.follower.ui.store.FollowerScreenState import com.stslex.wizard.feature.follower.ui.store.FollowerStore.Action import com.stslex.wizard.feature.follower.ui.store.FollowerStore.State diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/model/FollowerModel.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/model/FollowerModel.kt index 53bb091..55a21db 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/model/FollowerModel.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/model/FollowerModel.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.follower.ui.model import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem @Stable data class FollowerModel( diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerScreenState.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerScreenState.kt index b85d706..d172df5 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerScreenState.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerScreenState.kt @@ -1,8 +1,8 @@ package com.stslex.wizard.feature.follower.ui.store import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.base.AppError -import com.stslex.wizard.core.ui.pager.states.PagerLoadState +import com.stslex.wizard.core.ui.kit.base.AppError +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState @Stable sealed interface FollowerScreenState { diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerStore.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerStore.kt index 6422dbd..8d6b163 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerStore.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerStore.kt @@ -2,10 +2,10 @@ package com.stslex.wizard.feature.follower.ui.store import androidx.compose.runtime.Stable import com.stslex.wizard.core.navigation.Screen -import com.stslex.wizard.core.ui.base.paging.PagingConfig -import com.stslex.wizard.core.ui.base.paging.PagingUiState -import com.stslex.wizard.core.ui.mvi.CommonEvents -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig +import com.stslex.wizard.core.ui.kit.base.paging.PagingUiState +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.follower.ui.model.FollowerModel import com.stslex.wizard.feature.follower.ui.store.FollowerStore.Action import com.stslex.wizard.feature.follower.ui.store.FollowerStore.Event diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerStoreImpl.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerStoreImpl.kt index 08932aa..55e48a9 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerStoreImpl.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/ui/store/FollowerStoreImpl.kt @@ -1,13 +1,13 @@ package com.stslex.wizard.feature.follower.ui.store import com.stslex.wizard.core.navigation.Screen.Follower.FollowerType -import com.stslex.wizard.core.ui.base.mapToAppError -import com.stslex.wizard.core.ui.base.paging.toUi -import com.stslex.wizard.core.ui.mvi.BaseStore -import com.stslex.wizard.core.ui.mvi.CommonEvents.Snackbar -import com.stslex.wizard.core.ui.pager.pager.StorePager -import com.stslex.wizard.core.ui.pager.pager.StorePagerFactory -import com.stslex.wizard.core.ui.pager.states.PagerLoadState +import com.stslex.wizard.core.ui.kit.base.mapToAppError +import com.stslex.wizard.core.ui.kit.base.paging.toUi +import com.stslex.wizard.core.ui.kit.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents.Snackbar +import com.stslex.wizard.core.ui.kit.pager.pager.StorePager +import com.stslex.wizard.core.ui.kit.pager.pager.StorePagerFactory +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState import com.stslex.wizard.feature.follower.domain.interactor.FollowerInteractor import com.stslex.wizard.feature.follower.navigation.FollowerRouter import com.stslex.wizard.feature.follower.ui.model.FollowerModel diff --git a/feature/match/build.gradle.kts b/feature/match/build.gradle.kts index edf2763..5dc2370 100644 --- a/feature/match/build.gradle.kts +++ b/feature/match/build.gradle.kts @@ -5,8 +5,8 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) - implementation(project(":core:network")) + implementation(project(":core:ui:kit")) + implementation(project(":core:network:api")) implementation(project(":core:database")) implementation(project(":core:navigation")) } diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/model/MatchDataMapper.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/model/MatchDataMapper.kt index 5faedfa..0439855 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/model/MatchDataMapper.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/model/MatchDataMapper.kt @@ -1,9 +1,9 @@ package com.stslex.wizard.feature.match.data.model import com.stslex.wizard.core.core.asyncMap -import com.stslex.wizard.core.network.clients.match.model.response.MatchResponse -import com.stslex.wizard.core.network.clients.match.model.response.MatchStatusResponse -import com.stslex.wizard.core.network.clients.match.model.response.MatchUserResponse +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchResponse +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchStatusResponse +import com.stslex.wizard.core.network.api.clients.match.model.response.MatchUserResponse internal suspend fun MatchResponse.toData( userUUID: String diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/model/MatchDataModel.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/model/MatchDataModel.kt index 872b200..a5a7dd1 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/model/MatchDataModel.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/model/MatchDataModel.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.match.data.model -import com.stslex.wizard.core.ui.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem data class MatchDataModel( override val uuid: String, diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/repository/MatchRepositoryImpl.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/repository/MatchRepositoryImpl.kt index f10746e..53c40f3 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/repository/MatchRepositoryImpl.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/data/repository/MatchRepositoryImpl.kt @@ -3,8 +3,8 @@ package com.stslex.wizard.feature.match.data.repository import com.stslex.wizard.core.core.paging.PagingResponse import com.stslex.wizard.core.core.paging.pagingMap import com.stslex.wizard.core.database.store.UserStore -import com.stslex.wizard.core.network.clients.match.client.MatchClient -import com.stslex.wizard.core.network.model.PagingRequest +import com.stslex.wizard.core.network.api.clients.match.client.MatchClient +import com.stslex.wizard.core.network.api.model.PagingRequest import com.stslex.wizard.feature.match.data.model.MatchDataModel import com.stslex.wizard.feature.match.data.model.toData diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/di/ModuleFeatureMatch.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/di/ModuleFeatureMatch.kt index 1f2bc23..637367b 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/di/ModuleFeatureMatch.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/di/ModuleFeatureMatch.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.match.data.repository.MatchRepository import com.stslex.wizard.feature.match.data.repository.MatchRepositoryImpl import com.stslex.wizard.feature.match.domain.interactor.MatchInteractor diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/domain/interactor/MatchInteractorImpl.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/domain/interactor/MatchInteractorImpl.kt index d0c56c4..e116401 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/domain/interactor/MatchInteractorImpl.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/domain/interactor/MatchInteractorImpl.kt @@ -2,7 +2,7 @@ package com.stslex.wizard.feature.match.domain.interactor import com.stslex.wizard.core.core.paging.PagingResponse import com.stslex.wizard.core.core.paging.pagingMap -import com.stslex.wizard.core.network.utils.token.AuthController +import com.stslex.wizard.core.network.api.utils.token.AuthController import com.stslex.wizard.feature.match.data.repository.MatchRepository import com.stslex.wizard.feature.match.domain.model.MatchDomainModel import com.stslex.wizard.feature.match.domain.model.toDomain diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/domain/model/MatchDomainModel.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/domain/model/MatchDomainModel.kt index 88ec404..1cdbdf4 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/domain/model/MatchDomainModel.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/domain/model/MatchDomainModel.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.match.domain.model -import com.stslex.wizard.core.ui.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem data class MatchDomainModel( override val uuid: String, diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/navigation/GraphMatch.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/navigation/GraphMatch.kt index f5fa70e..a60cecd 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/navigation/GraphMatch.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/navigation/GraphMatch.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.match.ui.MatchScreen import com.stslex.wizard.feature.match.ui.store.MatchStore import com.stslex.wizard.feature.match.ui.store.MatchStore.Action diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/navigation/MatchRouter.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/navigation/MatchRouter.kt index b7487cc..1843c17 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/navigation/MatchRouter.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/navigation/MatchRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.match.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.match.ui.store.MatchStore interface MatchRouter : Router \ No newline at end of file diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/MatchScreen.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/MatchScreen.kt index 66e714a..dcd42be 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/MatchScreen.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/MatchScreen.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.components.AppSnackbarHost +import com.stslex.wizard.core.ui.kit.components.AppSnackbarHost import com.stslex.wizard.feature.match.ui.components.MatchScreenContent import com.stslex.wizard.feature.match.ui.components.MatchScreenEmpty import com.stslex.wizard.feature.match.ui.components.MatchScreenError diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/components/MatchScreenContent.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/components/MatchScreenContent.kt index f8d1453..b236812 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/components/MatchScreenContent.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/components/MatchScreenContent.kt @@ -17,10 +17,10 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.base.paging.PagingColumn -import com.stslex.wizard.core.ui.base.paging.PagingUiState -import com.stslex.wizard.core.ui.base.shimmerLoadingAnimation -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.base.paging.PagingColumn +import com.stslex.wizard.core.ui.kit.base.paging.PagingUiState +import com.stslex.wizard.core.ui.kit.base.shimmerLoadingAnimation +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.match.ui.model.MatchUiModel import com.stslex.wizard.feature.match.ui.store.MatchScreenState import com.stslex.wizard.feature.match.ui.store.MatchStore.Action diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/components/MatchScreenError.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/components/MatchScreenError.kt index b4e4781..7ee52c9 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/components/MatchScreenError.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/components/MatchScreenError.kt @@ -11,8 +11,8 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.base.AppError -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.base.AppError +import com.stslex.wizard.core.ui.kit.theme.AppDimension @Composable internal fun MatchScreenError( diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/model/MatchDataMapper.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/model/MatchDataMapper.kt index eb62b74..5cb66ca 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/model/MatchDataMapper.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/model/MatchDataMapper.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match.ui.model import com.stslex.wizard.core.core.asyncMap -import com.stslex.wizard.core.ui.pager.states.PagerLoadState +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState import com.stslex.wizard.feature.match.domain.model.MatchDomainModel import com.stslex.wizard.feature.match.domain.model.MatchDomainStatus import com.stslex.wizard.feature.match.domain.model.MatchUserDomainModel diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/model/MatchUiModel.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/model/MatchUiModel.kt index 07224dd..f67c4b1 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/model/MatchUiModel.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/model/MatchUiModel.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match.ui.model import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.base.paging.PagingItem +import com.stslex.wizard.core.ui.kit.base.paging.PagingItem import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchScreenState.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchScreenState.kt index ae3359f..42d3c99 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchScreenState.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchScreenState.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match.ui.store import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.base.AppError +import com.stslex.wizard.core.ui.kit.base.AppError @Stable sealed interface MatchScreenState { diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStore.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStore.kt index 0cd711a..a7fa73f 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStore.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStore.kt @@ -2,10 +2,10 @@ package com.stslex.wizard.feature.match.ui.store import androidx.compose.runtime.Stable import com.stslex.wizard.core.navigation.Screen -import com.stslex.wizard.core.ui.base.paging.PagingConfig -import com.stslex.wizard.core.ui.base.paging.PagingUiState -import com.stslex.wizard.core.ui.mvi.CommonEvents -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig +import com.stslex.wizard.core.ui.kit.base.paging.PagingUiState +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.match.ui.model.MatchUiModel import com.stslex.wizard.feature.match.ui.store.MatchStore.Action import com.stslex.wizard.feature.match.ui.store.MatchStore.Event diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStoreImpl.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStoreImpl.kt index b4e8246..9767d0a 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStoreImpl.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStoreImpl.kt @@ -3,13 +3,13 @@ package com.stslex.wizard.feature.match.ui.store import com.stslex.wizard.core.core.Logger import com.stslex.wizard.core.database.store.UserStore import com.stslex.wizard.core.navigation.Screen -import com.stslex.wizard.core.ui.base.mapToAppError -import com.stslex.wizard.core.ui.base.paging.toUi -import com.stslex.wizard.core.ui.mvi.BaseStore -import com.stslex.wizard.core.ui.mvi.CommonEvents.Snackbar -import com.stslex.wizard.core.ui.pager.pager.StorePager -import com.stslex.wizard.core.ui.pager.pager.StorePagerFactory -import com.stslex.wizard.core.ui.pager.states.PagerLoadState +import com.stslex.wizard.core.ui.kit.base.mapToAppError +import com.stslex.wizard.core.ui.kit.base.paging.toUi +import com.stslex.wizard.core.ui.kit.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents.Snackbar +import com.stslex.wizard.core.ui.kit.pager.pager.StorePager +import com.stslex.wizard.core.ui.kit.pager.pager.StorePagerFactory +import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState import com.stslex.wizard.feature.match.domain.interactor.MatchInteractor import com.stslex.wizard.feature.match.navigation.MatchRouter import com.stslex.wizard.feature.match.ui.model.MatchUiModel diff --git a/feature/match_feed/build.gradle.kts b/feature/match_feed/build.gradle.kts index 856a067..babfb3f 100644 --- a/feature/match_feed/build.gradle.kts +++ b/feature/match_feed/build.gradle.kts @@ -5,8 +5,9 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) - implementation(project(":core:network")) + implementation(project(":core:ui:kit")) + implementation(project(":core:ui:image")) + implementation(project(":core:network:api")) implementation(project(":core:navigation")) } } diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/data/repository/MatchFeedMockRepositoryImpl.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/data/repository/MatchFeedMockRepositoryImpl.kt index df7d964..ede6d45 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/data/repository/MatchFeedMockRepositoryImpl.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/data/repository/MatchFeedMockRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.match_feed.data.repository -import com.stslex.wizard.core.network.clients.film.client.FilmClient +import com.stslex.wizard.core.network.api.clients.film.client.FilmClient import com.stslex.wizard.feature.match_feed.data.model.FilmData import com.stslex.wizard.feature.match_feed.data.model.MatchData import com.stslex.wizard.feature.match_feed.data.model.MatchFilmsPagingData diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/data/repository/MatchFeedRepositoryImpl.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/data/repository/MatchFeedRepositoryImpl.kt index 95b0622..e346f29 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/data/repository/MatchFeedRepositoryImpl.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/data/repository/MatchFeedRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.match_feed.data.repository -import com.stslex.wizard.core.network.clients.film.client.FilmClient +import com.stslex.wizard.core.network.api.clients.film.client.FilmClient import com.stslex.wizard.feature.match_feed.data.model.MatchData import com.stslex.wizard.feature.match_feed.data.model.MatchFilmsPagingData import com.stslex.wizard.feature.match_feed.data.model.MatchPagingData diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/di/ModuleFeatureMatchFeed.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/di/ModuleFeatureMatchFeed.kt index 5e035a4..9b78ef6 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/di/ModuleFeatureMatchFeed.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/di/ModuleFeatureMatchFeed.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match_feed.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.match_feed.data.repository.MatchFeedMockRepositoryImpl import com.stslex.wizard.feature.match_feed.data.repository.MatchFeedRepository import com.stslex.wizard.feature.match_feed.domain.MatchFeedInteractor diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/navigation/GraphMatchFeed.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/navigation/GraphMatchFeed.kt index 4e31727..81b430b 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/navigation/GraphMatchFeed.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/navigation/GraphMatchFeed.kt @@ -7,7 +7,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.match_feed.ui.MatchFeedScreen import com.stslex.wizard.feature.match_feed.ui.store.MatchFeedStore import com.stslex.wizard.feature.match_feed.ui.store.MatchFeedStore.Action diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/navigation/MatchFeedRouter.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/navigation/MatchFeedRouter.kt index 7bbd98f..9d05ae5 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/navigation/MatchFeedRouter.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/navigation/MatchFeedRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.match_feed.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.match_feed.ui.store.MatchFeedStore interface MatchFeedRouter : Router diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/components/MatchFeedScreenFilmItem.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/components/MatchFeedScreenFilmItem.kt index 96d54e8..3e66dee 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/components/MatchFeedScreenFilmItem.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/components/MatchFeedScreenFilmItem.kt @@ -35,9 +35,9 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.Dp -import com.stslex.wizard.core.ui.base.image.AppImage -import com.stslex.wizard.core.ui.base.onClickDelay -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.image.AppImage +import com.stslex.wizard.core.ui.kit.base.onClickDelay +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.match_feed.ui.model.FilmUi import kotlinx.collections.immutable.ImmutableList import kotlinx.coroutines.delay diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/store/MatchFeedStore.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/store/MatchFeedStore.kt index fd27343..a2850f0 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/store/MatchFeedStore.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/store/MatchFeedStore.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match_feed.ui.store import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.match_feed.ui.components.SwipeDirection import com.stslex.wizard.feature.match_feed.ui.model.FilmUi import com.stslex.wizard.feature.match_feed.ui.model.MatchUi diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/store/MatchFeedStoreImpl.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/store/MatchFeedStoreImpl.kt index af4dafd..3e145e6 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/store/MatchFeedStoreImpl.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/store/MatchFeedStoreImpl.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match_feed.ui.store import com.stslex.wizard.core.core.Logger -import com.stslex.wizard.core.ui.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.BaseStore import com.stslex.wizard.feature.match_feed.domain.MatchFeedInteractor import com.stslex.wizard.feature.match_feed.navigation.MatchFeedRouter import com.stslex.wizard.feature.match_feed.ui.model.toUI diff --git a/feature/profile/build.gradle.kts b/feature/profile/build.gradle.kts index edf2763..62822db 100644 --- a/feature/profile/build.gradle.kts +++ b/feature/profile/build.gradle.kts @@ -5,8 +5,9 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) - implementation(project(":core:network")) + implementation(project(":core:ui:kit")) + implementation(project(":core:ui:image")) + implementation(project(":core:network:api")) implementation(project(":core:database")) implementation(project(":core:navigation")) } diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/data/model/ProfileDataMapper.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/data/model/ProfileDataMapper.kt index 5ef4bb1..6860623 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/data/model/ProfileDataMapper.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/data/model/ProfileDataMapper.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.profile.data.model -import com.stslex.wizard.core.network.clients.profile.model.response.UserResponse +import com.stslex.wizard.core.network.api.clients.profile.model.response.UserResponse fun UserResponse.toData() = ProfileDataModel( uuid = uuid, diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/data/repository/ProfileRepositoryImpl.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/data/repository/ProfileRepositoryImpl.kt index 717b0b2..2ba7f48 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/data/repository/ProfileRepositoryImpl.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/data/repository/ProfileRepositoryImpl.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.profile.data.repository import com.stslex.wizard.core.database.store.UserStore -import com.stslex.wizard.core.network.clients.profile.client.ProfileClient +import com.stslex.wizard.core.network.api.clients.profile.client.ProfileClient import com.stslex.wizard.feature.profile.data.model.ProfileDataModel import com.stslex.wizard.feature.profile.data.model.toData import kotlinx.coroutines.flow.Flow diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/di/ModuleFeatureProfile.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/di/ModuleFeatureProfile.kt index 6ce0163..39f857e 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/di/ModuleFeatureProfile.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/di/ModuleFeatureProfile.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.profile.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.profile.data.repository.ProfileRepository import com.stslex.wizard.feature.profile.data.repository.ProfileRepositoryImpl import com.stslex.wizard.feature.profile.domain.interactor.ProfileInteractor diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/domain/interactor/ProfileInteractorImpl.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/domain/interactor/ProfileInteractorImpl.kt index ea815c1..38d0f45 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/domain/interactor/ProfileInteractorImpl.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/domain/interactor/ProfileInteractorImpl.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.profile.domain.interactor -import com.stslex.wizard.core.network.utils.token.AuthController +import com.stslex.wizard.core.network.api.utils.token.AuthController import com.stslex.wizard.feature.profile.data.repository.ProfileRepository import com.stslex.wizard.feature.profile.domain.model.ProfileDomainModel import com.stslex.wizard.feature.profile.domain.model.toDomain diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/navigation/GraphProfile.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/navigation/GraphProfile.kt index 404f715..fb12a2c 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/navigation/GraphProfile.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/navigation/GraphProfile.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.profile.ui.ProfileScreen import com.stslex.wizard.feature.profile.ui.store.ProfileStoreImpl import com.stslex.wizard.feature.profile.ui.store.ProfileStore.Action diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/navigation/ProfileRouter.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/navigation/ProfileRouter.kt index 8f7d899..af581bd 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/navigation/ProfileRouter.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/navigation/ProfileRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.profile.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.profile.ui.store.ProfileStore interface ProfileRouter : Router \ No newline at end of file diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/ProfileScreen.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/ProfileScreen.kt index fff1760..c3b7828 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/ProfileScreen.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/ProfileScreen.kt @@ -16,8 +16,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import com.stslex.wizard.core.core.error.ErrorRefresh -import com.stslex.wizard.core.ui.components.AppSnackbarHost -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.components.AppSnackbarHost +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.profile.ui.components.ProfileScreenContent import com.stslex.wizard.feature.profile.ui.store.ProfileScreenState import com.stslex.wizard.feature.profile.ui.store.ProfileStore.Action diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileAvatar.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileAvatar.kt index 2bf7731..a39d29d 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileAvatar.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileAvatar.kt @@ -9,8 +9,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import com.stslex.wizard.core.ui.base.image.AppImage -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.image.AppImage +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.profile.ui.model.ProfileAvatarModel @Composable diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileInfo.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileInfo.kt index c4d18cd..e1a04e9 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileInfo.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileInfo.kt @@ -10,7 +10,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.AppDimension @Composable fun ProfileInfo( diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileScreenToolbar.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileScreenToolbar.kt index 393d86e..dc9f03d 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileScreenToolbar.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileScreenToolbar.kt @@ -7,7 +7,7 @@ import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.components.AppToolbar +import com.stslex.wizard.core.ui.kit.components.AppToolbar @Composable fun ProfileScreenToolbar( diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/store/ProfileStore.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/store/ProfileStore.kt index fe7e868..eab2f78 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/store/ProfileStore.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/store/ProfileStore.kt @@ -2,8 +2,8 @@ package com.stslex.wizard.feature.profile.ui.store import androidx.compose.runtime.Stable import com.stslex.wizard.core.navigation.Screen -import com.stslex.wizard.core.ui.mvi.CommonEvents -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.profile.ui.store.ProfileStore.Action import com.stslex.wizard.feature.profile.ui.store.ProfileStore.Event import com.stslex.wizard.feature.profile.ui.store.ProfileStore.State diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/store/ProfileStoreImpl.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/store/ProfileStoreImpl.kt index 09d69e2..0a048b7 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/store/ProfileStoreImpl.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/store/ProfileStoreImpl.kt @@ -3,8 +3,8 @@ package com.stslex.wizard.feature.profile.ui.store import androidx.compose.ui.graphics.Color import com.stslex.wizard.core.database.store.UserStore import com.stslex.wizard.core.navigation.Screen -import com.stslex.wizard.core.ui.mvi.BaseStore -import com.stslex.wizard.core.ui.mvi.CommonEvents.Snackbar +import com.stslex.wizard.core.ui.kit.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents.Snackbar import com.stslex.wizard.feature.profile.domain.interactor.ProfileInteractor import com.stslex.wizard.feature.profile.navigation.ProfileRouter import com.stslex.wizard.feature.profile.ui.model.ProfileAvatarModel diff --git a/feature/settings/build.gradle.kts b/feature/settings/build.gradle.kts index 978a78b..4cb9e77 100644 --- a/feature/settings/build.gradle.kts +++ b/feature/settings/build.gradle.kts @@ -5,8 +5,8 @@ plugins { kotlin { sourceSets.commonMain.dependencies { implementation(project(":core:core")) - implementation(project(":core:ui")) - implementation(project(":core:network")) + implementation(project(":core:ui:kit")) + implementation(project(":core:network:api")) implementation(project(":core:database")) implementation(project(":core:navigation")) } diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/di/ModuleFeatureSettings.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/di/ModuleFeatureSettings.kt index 9280760..1845c8f 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/di/ModuleFeatureSettings.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/di/ModuleFeatureSettings.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.settings.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeOf +import com.stslex.wizard.core.ui.kit.mvi.storeOf import com.stslex.wizard.feature.settings.domain.SettingsInteractor import com.stslex.wizard.feature.settings.domain.SettingsInteractorImpl import com.stslex.wizard.feature.settings.navigation.SettingsRouter diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/domain/SettingsInteractorImpl.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/domain/SettingsInteractorImpl.kt index e53b07d..bca68c9 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/domain/SettingsInteractorImpl.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/domain/SettingsInteractorImpl.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.settings.domain -import com.stslex.wizard.core.network.utils.token.AuthController +import com.stslex.wizard.core.network.api.utils.token.AuthController class SettingsInteractorImpl( private val authController: AuthController diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/navigation/GraphSettings.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/navigation/GraphSettings.kt index 0be69c4..79289d5 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/navigation/GraphSettings.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/navigation/GraphSettings.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.remember import androidx.navigation.NavGraphBuilder import com.stslex.wizard.core.navigation.Screen import com.stslex.wizard.core.navigation.navScreen -import com.stslex.wizard.core.ui.mvi.getStore +import com.stslex.wizard.core.ui.kit.mvi.getStore import com.stslex.wizard.feature.settings.ui.SettingsScreen import com.stslex.wizard.feature.settings.ui.store.SettingsStoreImpl import com.stslex.wizard.feature.settings.ui.store.SettingsStore.Event diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/navigation/SettingsRouter.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/navigation/SettingsRouter.kt index b4157e6..d1e4c02 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/navigation/SettingsRouter.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/navigation/SettingsRouter.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.feature.settings.navigation -import com.stslex.wizard.core.ui.mvi.Router +import com.stslex.wizard.core.ui.kit.mvi.Router import com.stslex.wizard.feature.settings.ui.store.SettingsStore interface SettingsRouter : Router diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/SettingsScreen.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/SettingsScreen.kt index 7026205..b6c5a01 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/SettingsScreen.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/SettingsScreen.kt @@ -11,9 +11,9 @@ import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.stslex.wizard.core.ui.components.AppSnackbarHost -import com.stslex.wizard.core.ui.components.AppToolbar -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.components.AppSnackbarHost +import com.stslex.wizard.core.ui.kit.components.AppToolbar +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.settings.ui.components.SettingsContent import com.stslex.wizard.feature.settings.ui.store.SettingsStore.Action import com.stslex.wizard.feature.settings.ui.store.SettingsStore.State diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/components/SettingsContent.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/components/SettingsContent.kt index 64d1a32..b14c6a8 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/components/SettingsContent.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/components/SettingsContent.kt @@ -16,7 +16,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.text.style.TextOverflow -import com.stslex.wizard.core.ui.theme.AppDimension +import com.stslex.wizard.core.ui.kit.theme.AppDimension import com.stslex.wizard.feature.settings.ui.model.SettingsColumnItems @Composable diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/store/SettingsStore.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/store/SettingsStore.kt index b8d1e7a..51f038d 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/store/SettingsStore.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/store/SettingsStore.kt @@ -1,8 +1,8 @@ package com.stslex.wizard.feature.settings.ui.store import androidx.compose.runtime.Stable -import com.stslex.wizard.core.ui.mvi.CommonEvents -import com.stslex.wizard.core.ui.mvi.Store +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents +import com.stslex.wizard.core.ui.kit.mvi.Store import com.stslex.wizard.feature.settings.ui.store.SettingsStore.Action import com.stslex.wizard.feature.settings.ui.store.SettingsStore.Event import com.stslex.wizard.feature.settings.ui.store.SettingsStore.State diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/store/SettingsStoreImpl.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/store/SettingsStoreImpl.kt index 16c730d..0faa8ff 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/store/SettingsStoreImpl.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/ui/store/SettingsStoreImpl.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.settings.ui.store -import com.stslex.wizard.core.ui.mvi.BaseStore -import com.stslex.wizard.core.ui.mvi.CommonEvents.Snackbar +import com.stslex.wizard.core.ui.kit.mvi.BaseStore +import com.stslex.wizard.core.ui.kit.mvi.CommonEvents.Snackbar import com.stslex.wizard.feature.settings.domain.SettingsInteractor import com.stslex.wizard.feature.settings.navigation.SettingsRouter import com.stslex.wizard.feature.settings.ui.store.SettingsStore.Action diff --git a/settings.gradle.kts b/settings.gradle.kts index 6133ccf..9cf6536 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,12 +20,18 @@ rootProject.name = "Wizard" include(":iosApp") include(":commonApp") +// Core include(":core:core") -include(":core:network") -include(":core:ui") +// Network +include(":core:network:client") +include(":core:network:api") +// UI +include(":core:ui:kit") +include(":core:ui:image") +// Other include(":core:database") include(":core:navigation") - +// Features include(":feature:film_feed") include(":feature:film") include(":feature:profile")