diff --git a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/PostsAPI.kt b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/PostsAPI.kt new file mode 100644 index 00000000..d46b15dd --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/PostsAPI.kt @@ -0,0 +1,12 @@ +package com.github.insanusmokrassar.postssystem.core.api + +import com.github.insanusmokrassar.postssystem.core.post.Post +import com.github.insanusmokrassar.postssystem.core.post.PostId +import com.github.insanusmokrassar.postssystem.core.content.ContentId +import org.joda.time.DateTime + +interface PostsAPI { + suspend fun getPostById(id: PostId): Post? + suspend fun getPostsByContent(id: ContentId): List + suspend fun getPostsByDates(from: DateTime? = null, to: DateTime? = null): List +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/Post.kt b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/Post.kt similarity index 65% rename from src/main/kotlin/com/github/insanusmokrassar/postssystem/core/Post.kt rename to src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/Post.kt index 11ddd6a3..08a0e98f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/Post.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/Post.kt @@ -1,4 +1,4 @@ -package com.github.insanusmokrassar.postssystem.core +package com.github.insanusmokrassar.postssystem.core.post import com.github.insanusmokrassar.postssystem.core.content.Content @@ -7,4 +7,6 @@ typealias PostId = String interface Post { val id: PostId val content: List + + val meta: PostMetaInfo } \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/PostMetaInfo.kt b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/PostMetaInfo.kt new file mode 100644 index 00000000..345951a9 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/PostMetaInfo.kt @@ -0,0 +1,9 @@ +package com.github.insanusmokrassar.postssystem.core.post + +import org.joda.time.DateTime + +interface PostMetaInfo { + val postId: PostId + val creationDate: DateTime + val modificationDate: DateTime +} \ No newline at end of file