add TextContent

This commit is contained in:
InsanusMokrassar 2021-11-24 20:32:21 +06:00
parent 58b7e973be
commit 5d54fa274a
12 changed files with 85 additions and 0 deletions

View File

@ -21,6 +21,7 @@ kotlin {
api project(":postssystem.features.roles.client")
api project(":postssystem.features.roles.manager.client")
api project(":postssystem.features.content.client")
api project(":postssystem.features.content.text.client")
api "dev.inmo:micro_utils.fsm.common:$microutils_version"
api "dev.inmo:micro_utils.fsm.repos.common:$microutils_version"
api "dev.inmo:micro_utils.crypto:$microutils_version"

View File

@ -28,6 +28,7 @@ import dev.inmo.postssystem.features.common.common.SerializersModuleConfigurator
import dev.inmo.postssystem.features.common.common.singleWithRandomQualifier
import dev.inmo.postssystem.features.content.common.ContentSerializersModuleConfigurator
import dev.inmo.postssystem.features.content.common.OtherContentSerializerModuleConfigurator
import dev.inmo.postssystem.features.content.content.text.common.TextContentSerializerModuleConfigurator
import dev.inmo.postssystem.features.status.client.StatusFeatureClient
import io.ktor.client.HttpClient
import kotlinx.coroutines.CoroutineScope
@ -67,6 +68,7 @@ fun baseKoin(
modules(
module {
singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> { OtherContentSerializerModuleConfigurator }
singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> { TextContentSerializerModuleConfigurator }
singleWithRandomQualifier<SerializersModuleConfigurator.Element> { ContentSerializersModuleConfigurator(getAll()) }
single { SerializersModuleConfigurator(getAll()) }

View File

@ -0,0 +1,18 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "com.android.library"
}
apply from: "$mppProjectWithSerializationPresetPath"
kotlin {
sourceSets {
commonMain {
dependencies {
api project(":postssystem.features.content.text.common")
api project(":postssystem.features.common.client")
}
}
}
}

View File

@ -0,0 +1 @@
<manifest package="dev.inmo.postssystem.features.content.content.text.client"/>

View File

@ -0,0 +1,18 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "com.android.library"
}
apply from: "$mppProjectWithSerializationPresetPath"
kotlin {
sourceSets {
commonMain {
dependencies {
api project(":postssystem.features.common.common")
api project(":postssystem.features.content.common")
}
}
}
}

View File

@ -0,0 +1,9 @@
package dev.inmo.postssystem.features.content.content.text.common
import dev.inmo.postssystem.features.content.common.Content
import kotlinx.serialization.Serializable
@Serializable
data class TextContent(
val text: String
) : Content

View File

@ -0,0 +1,11 @@
package dev.inmo.postssystem.features.content.content.text.common
import dev.inmo.postssystem.features.content.common.Content
import dev.inmo.postssystem.features.content.common.ContentSerializersModuleConfigurator
import kotlinx.serialization.modules.PolymorphicModuleBuilder
object TextContentSerializerModuleConfigurator : ContentSerializersModuleConfigurator.Element {
override fun PolymorphicModuleBuilder<Content>.invoke() {
subclass(TextContent::class, TextContent.serializer())
}
}

View File

@ -0,0 +1 @@
<manifest package="dev.inmo.postssystem.features.content.content.text.common"/>

View File

@ -0,0 +1,17 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJavaProjectPresetPath"
kotlin {
sourceSets {
commonMain {
dependencies {
api project(":postssystem.features.content.text.common")
api project(":postssystem.features.common.server")
}
}
}
}

View File

@ -19,6 +19,7 @@ dependencies {
api project(":postssystem.features.roles.server")
api project(":postssystem.features.roles.manager.server")
api project(":postssystem.features.content.server")
api project(":postssystem.features.content.text.server")
api "io.ktor:ktor-server-netty:$ktor_version"
api "io.ktor:ktor-websockets:$ktor_version"
api "org.jetbrains.exposed:exposed-jdbc:$kotlin_exposed_version"

View File

@ -28,6 +28,7 @@ import dev.inmo.micro_utils.repos.exposed.onetomany.ExposedOneToManyKeyValueRepo
import dev.inmo.postssystem.features.common.common.*
import dev.inmo.postssystem.features.content.common.ContentSerializersModuleConfigurator
import dev.inmo.postssystem.features.content.common.OtherContentSerializerModuleConfigurator
import dev.inmo.postssystem.features.content.content.text.common.TextContentSerializerModuleConfigurator
import io.ktor.application.featureOrNull
import io.ktor.application.log
import io.ktor.routing.Route
@ -72,6 +73,7 @@ fun getDIModule(
return module {
singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> { OtherContentSerializerModuleConfigurator }
singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> { TextContentSerializerModuleConfigurator }
singleWithRandomQualifier<SerializersModuleConfigurator.Element> { ContentSerializersModuleConfigurator(getAll()) }
single { SerializersModuleConfigurator(getAll()) }

View File

@ -33,6 +33,10 @@ String[] includes = [
":features:content:client",
":features:content:server",
":features:content:text:common",
":features:content:text:client",
":features:content:text:server",
":server",
":client",
]