-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from stslex/dev
dev
- Loading branch information
Showing
27 changed files
with
399 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsCompose) | ||
kotlin("plugin.serialization") version "1.9.20" | ||
} | ||
|
||
kotlin { | ||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
} | ||
|
||
jvm("desktop") | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = "database" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(project(":core:core")) | ||
implementation(libs.kotlinx.serialization.json) | ||
} | ||
commonTest.dependencies { | ||
implementation(libs.kotlin.test) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "com.stslex.core.database" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
defaultConfig { | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
core/database/src/commonMain/kotlin/com/stslex/core/database/di/DatabaseModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.stslex.core.database.di | ||
|
||
import com.stslex.core.database.sources.source.FavouriteFilmDataSource | ||
import com.stslex.core.database.sources.source.FavouriteFilmDataSourceImpl | ||
import org.koin.dsl.module | ||
|
||
val databaseModule = module { | ||
single<FavouriteFilmDataSource> { FavouriteFilmDataSourceImpl() } | ||
} |
18 changes: 18 additions & 0 deletions
18
core/database/src/commonMain/kotlin/com/stslex/core/database/sources/model/FilmEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.stslex.core.database.sources.model | ||
|
||
data class FilmEntity( | ||
val id: String, | ||
val title: String, | ||
val description: String, | ||
val poster: String, | ||
val rating: String, | ||
val duration: String, | ||
val genres: List<String>, | ||
val actors: List<String>, | ||
val director: String, | ||
val country: String, | ||
val year: String, | ||
val age: String, | ||
val type: String, | ||
val trailer: String, | ||
) |
12 changes: 12 additions & 0 deletions
12
.../src/commonMain/kotlin/com/stslex/core/database/sources/source/FavouriteFilmDataSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.stslex.core.database.sources.source | ||
|
||
import com.stslex.core.database.sources.model.FilmEntity | ||
|
||
interface FavouriteFilmDataSource { | ||
|
||
suspend fun getFilm(id: String): FilmEntity? | ||
|
||
suspend fun likeFilm(filmEntity: FilmEntity) | ||
|
||
suspend fun dislikeFilm(id: String) | ||
} |
19 changes: 19 additions & 0 deletions
19
.../commonMain/kotlin/com/stslex/core/database/sources/source/FavouriteFilmDataSourceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.stslex.core.database.sources.source | ||
|
||
import com.stslex.core.database.sources.model.FilmEntity | ||
|
||
class FavouriteFilmDataSourceImpl : FavouriteFilmDataSource { | ||
|
||
override suspend fun getFilm(id: String): FilmEntity? { | ||
return null | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun likeFilm(filmEntity: FilmEntity) { | ||
// TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun dislikeFilm(id: String) { | ||
// TODO("Not yet implemented") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.