add including of contents serializers
This commit is contained in:
parent
cc5a498436
commit
ed46c888e3
@ -1,10 +1,7 @@
|
||||
package dev.inmo.postssystem.core.content
|
||||
|
||||
import dev.inmo.micro_utils.common.ByteArrayAllocator
|
||||
import dev.inmo.micro_utils.common.ByteArrayAllocatorSerializer
|
||||
import dev.inmo.micro_utils.mime_types.KnownMimeTypes
|
||||
import dev.inmo.micro_utils.mime_types.MimeType
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.modules.*
|
||||
|
||||
typealias ContentId = String
|
||||
|
||||
@ -23,6 +20,14 @@ data class OtherContentLinkContent(
|
||||
) : Content
|
||||
|
||||
|
||||
fun SerializersModuleBuilder.includeContentsSerializers(
|
||||
block: PolymorphicModuleBuilder<Content>.() -> Unit
|
||||
) {
|
||||
polymorphic(Content::class) {
|
||||
subclass(OtherContentLinkContent::class, OtherContentLinkContent.serializer())
|
||||
block()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Content which is already registered in database. Using its [id] you can retrieve all known
|
||||
|
Loading…
Reference in New Issue
Block a user