.. | ||
binary | ||
client | ||
common | ||
server | ||
text | ||
README.MD |
How to create content?
For example, you want to create content named "MyFormat". To do this, you must perform the following actions:
- Copy "template" folder from "core/features" in "core/features/content"
- Rename this folder in "myformat"
- Inside the "myformat" folder rename all the "template" on "content.myformat"
- In the "settings.gradle" file in the "includes" array add the following code:
":features:content:myformat:common",
":features:content:myformat:client",
":features:content:myformat:server",
- In the "core/features/content/myformat/common/src" folder create folders with appropriate subfolders "commonMain/kotlin/dev/inmo/postssystem/features/content/myformat/common":
- In the last folder "сommon", create a data class and the configurator as shown below:
@Serializable
data class MyFormatContent(
// Your code
) : Content
object MyFormatContentSerializerModuleConfigurator : ContentSerializersModuleConfigurator.Element {
override fun PolymorphicModuleBuilder<Content>.invoke() {
subclass(MyFormatContent::class, MyFormatContent.serializer())
}
}
- In two "di.kt" file located in "core/client/src/commonMain/kotlin/dev/inmo/postsystem/client" and "core/server/src/main/java/dev/inmo/postsystem/client" respectively add the following string:
singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> { MyFormatContentSerializerModuleConfigurator }