Serialization fixes

This commit is contained in:
InsanusMokrassar 2019-11-04 20:57:54 +06:00
parent 44d89b3a47
commit 6c50bb0e97
2 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,7 @@ typealias ContentId = String
/**
* Content which is planned to be registered in database
*/
@Serializable
sealed class Content
@Serializable
@ -24,6 +25,7 @@ data class SimpleTextContent(
* [com.insanusmokrassar.postssystem.core.post.RegisteredPost]s by using
* [com.insanusmokrassar.postssystem.core.post.api.ReadPostsAPI.getPostsByContent]
*/
@Serializable
data class RegisteredContent(
val id: ContentId,
val content: Content

View File

@ -1,10 +1,13 @@
package com.insanusmokrassar.postssystem.core.utils.pagination
import kotlinx.serialization.Serializable
@Serializable
data class PaginationResult<T>(
override val page: Int,
val pagesNumber: Int,
val results: List<T>,
override val size: Int = results.size
override val size: Int
) : Pagination
fun <T> Pagination.createResult(