This commit is contained in:
alexander 2021-12-05 13:47:54 +00:00
parent a1ea6a08fa
commit 20024d65d9

View File

@ -1,20 +1,18 @@
## How to create content? ## How to create content?
For example, you want to create content named "MyFormat". To do this, you must perform the following actions: For example, you want to create content named "MyFormat". To do this, you must perform the following actions:
1. Copy "template" folder from "core/features" in "core/features/content" 1. Copy "template" folder from "core/features" in "core/features/content"
2. Rename this folder in "myformat" 2. Rename this folder in "myformat"
3. Inside the "myformat" folder rename all the "template" on "content.myformat" 3. Inside the "myformat" folder rename all the "template" on "content.myformat"
4. In the "settings.gradle" file in the "includes" array add the following code: 4. In the "settings.gradle" file in the "includes" array add the following code:
```kotlin ```kotlin
":features:content:myformat:common", ":features:content:myformat:common",
":features:content:myformat:client", ":features:content:myformat:client",
":features:content:myformat:server", ":features:content:myformat:server",
``` ```
5. In the "core/features/content/myformat/common/src" folder create folders with appropriate subfolders "commonMain/kotlin/dev/inmo/postssystem/features/content/myformat/common": 5. In the "core/features/content/myformat/common/src" folder create folders with appropriate subfolders "commonMain/kotlin/dev/inmo/postssystem/features/content/myformat/common":
6. In the last folder "сommon", create a data class and the configurator as shown below: 6. In the last folder "сommon", create a data class and the configurator as shown below:
```kotlin ```kotlin
@Serializable @Serializable
data class MyFormatContent( data class MyFormatContent(
@ -29,9 +27,7 @@ object MyFormatContentSerializerModuleConfigurator : ContentSerializersModuleCon
} }
} }
``` ```
7. 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: 7. 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:
```kotlin ```kotlin
singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> { MyFormatContentSerializerModuleConfigurator } singleWithRandomQualifier<ContentSerializersModuleConfigurator.Element> { MyFormatContentSerializerModuleConfigurator }
``` ```