temporal unworkable progress
This commit is contained in:
client
features
common
client
common
src
commonMain
kotlin
dev
inmo
postssystem
features
common
common
content
client
src
jsMain
kotlin
dev
inmo
postssystem
features
content
client
text
client
gradle
server/src/main/resources/web
services/posts
client
src
commonMain
kotlin
dev
inmo
postssystem
services
posts
server
src
jvmMain
kotlin
dev
inmo
postssystem
services
posts
targets/telegram
content
polls
client
build.gradle
src
common
server
loader
client
server
template
18
targets/telegram/content/polls/client/build.gradle
Normal file
18
targets/telegram/content/polls/client/build.gradle
Normal 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.targets.telegram.content.polls.common")
|
||||
api project(":postssystem.features.common.client")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<manifest package="dev.inmo.postssystem.targets.telegram.content.polls.client"/>
|
18
targets/telegram/content/polls/common/build.gradle
Normal file
18
targets/telegram/content/polls/common/build.gradle
Normal 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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
16
targets/telegram/content/polls/common/src/commonMain/kotlin/dev/inmo/postssystem/targets/telegram/content/polls/common/PollContent.kt
Normal file
16
targets/telegram/content/polls/common/src/commonMain/kotlin/dev/inmo/postssystem/targets/telegram/content/polls/common/PollContent.kt
Normal file
@ -0,0 +1,16 @@
|
||||
package dev.inmo.postssystem.targets.telegram.content.polls.common
|
||||
|
||||
import dev.inmo.postssystem.features.content.common.Content
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class PollContent(
|
||||
val options: List<String>,
|
||||
val answer: Int?
|
||||
) : Content {
|
||||
init {
|
||||
require(answer == null || answer in options.indices) {
|
||||
"Answer should be in indexes of options ($options), ($answer)"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<manifest package="dev.inmo.postssystem.targets.telegram.content.polls.common"/>
|
17
targets/telegram/content/polls/server/build.gradle
Normal file
17
targets/telegram/content/polls/server/build.gradle
Normal 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.targets.telegram.content.polls.common")
|
||||
api project(":postssystem.features.common.server")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
0
targets/telegram/content/polls/server/src/jvmMain/kotlin/dev/inmo/postssystem/targets/telegram/content/polls/server/.gitkeep
Normal file
0
targets/telegram/content/polls/server/src/jvmMain/kotlin/dev/inmo/postssystem/targets/telegram/content/polls/server/.gitkeep
Normal file
@ -12,6 +12,7 @@ kotlin {
|
||||
dependencies {
|
||||
api project(":postssystem.targets.telegram.loader.common")
|
||||
api project(":postssystem.features.common.client")
|
||||
api project(":postssystem.targets.telegram.content.polls.client")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
22
targets/telegram/loader/client/src/commonMain/kotlin/dev/inmo/postssystem/targets/telegram/loader/client/TelegramTargetModuleLoader.kt
Normal file
22
targets/telegram/loader/client/src/commonMain/kotlin/dev/inmo/postssystem/targets/telegram/loader/client/TelegramTargetModuleLoader.kt
Normal file
@ -0,0 +1,22 @@
|
||||
package dev.inmo.postssystem.targets.telegram.loader.client
|
||||
|
||||
import dev.inmo.postssystem.features.common.common.*
|
||||
import dev.inmo.postssystem.features.content.common.ContentSerializersModuleConfigurator
|
||||
import dev.inmo.postssystem.targets.telegram.content.polls.common.PollContent
|
||||
import org.koin.core.module.Module
|
||||
|
||||
val defaultTelegramTargetModuleLoader = TelegramTargetModuleLoader
|
||||
|
||||
object TelegramTargetModuleLoader : ModuleLoader {
|
||||
init {
|
||||
AdditionalModules.addModule(this)
|
||||
}
|
||||
|
||||
override fun Module.load() {
|
||||
singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> {
|
||||
ContentSerializersModuleConfigurator.Element {
|
||||
subclass(PollContent::class, PollContent.serializer())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@ kotlin {
|
||||
dependencies {
|
||||
api project(":postssystem.targets.telegram.loader.common")
|
||||
api project(":postssystem.targets.telegram.publication.server")
|
||||
api project(":postssystem.targets.telegram.content.polls.server")
|
||||
api project(":postssystem.features.common.server")
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package dev.inmo.postssystem.targets.telegram.loader.server
|
||||
|
||||
import dev.inmo.postssystem.features.common.common.singleWithRandomQualifier
|
||||
import dev.inmo.postssystem.features.common.server.sessions.ModuleLoader
|
||||
import dev.inmo.postssystem.features.content.common.ContentSerializersModuleConfigurator
|
||||
import dev.inmo.postssystem.features.publication.server.PublicationTarget
|
||||
import dev.inmo.postssystem.targets.telegram.content.polls.common.PollContent
|
||||
import dev.inmo.postssystem.targets.telegram.publication.server.PublicationTargetTelegram
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
@ -28,6 +30,11 @@ class TelegramTargetModuleLoader : ModuleLoader {
|
||||
singleWithRandomQualifier<PublicationTarget> {
|
||||
PublicationTargetTelegram(get(), get(postingChatIdQualifier))
|
||||
}
|
||||
singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> {
|
||||
ContentSerializersModuleConfigurator.Element {
|
||||
subclass(PollContent::class, PollContent.serializer())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
18
targets/telegram/template/client/build.gradle
Normal file
18
targets/telegram/template/client/build.gradle
Normal 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.targets.telegram.template.common")
|
||||
api project(":postssystem.features.common.client")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
0
targets/telegram/template/client/src/commonMain/kotlin/dev/inmo/postssystem/targets/telegram/template/client/.gitkeep
Normal file
0
targets/telegram/template/client/src/commonMain/kotlin/dev/inmo/postssystem/targets/telegram/template/client/.gitkeep
Normal file
@ -0,0 +1 @@
|
||||
<manifest package="dev.inmo.postssystem.targets.telegram.template.client"/>
|
17
targets/telegram/template/common/build.gradle
Normal file
17
targets/telegram/template/common/build.gradle
Normal file
@ -0,0 +1,17 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
0
targets/telegram/template/common/src/commonMain/kotlin/dev/inmo/postssystem/targets/telegram/template/common/.gitkeep
Normal file
0
targets/telegram/template/common/src/commonMain/kotlin/dev/inmo/postssystem/targets/telegram/template/common/.gitkeep
Normal file
@ -0,0 +1 @@
|
||||
<manifest package="dev.inmo.postssystem.targets.telegram.template.common"/>
|
17
targets/telegram/template/server/build.gradle
Normal file
17
targets/telegram/template/server/build.gradle
Normal 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.targets.telegram.template.common")
|
||||
api project(":postssystem.features.common.server")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user