renames of markup creator

This commit is contained in:
InsanusMokrassar 2020-08-01 10:25:09 +06:00
parent 5dd6a1f3f5
commit 47805b9e91
4 changed files with 10 additions and 10 deletions

View File

@ -6,12 +6,12 @@ import com.insanusmokrassar.postssystem.core.post.PostId
import com.insanusmokrassar.postssystem.core.post.RegisteredPost import com.insanusmokrassar.postssystem.core.post.RegisteredPost
import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo
abstract class AbstractMarkupCreator<MarkupTarget>( abstract class AbstractMarkupBuilderFactory<MarkupTarget>(
@Suppress("MemberVisibilityCanBePrivate") @Suppress("MemberVisibilityCanBePrivate")
protected val postsRepo: ReadPostsRepo, protected val postsRepo: ReadPostsRepo,
@Suppress("MemberVisibilityCanBePrivate") @Suppress("MemberVisibilityCanBePrivate")
protected val postsContentRepo: ReadContentRepo protected val postsContentRepo: ReadContentRepo
) : MarkupCreator<MarkupTarget> { ) : MarkupBuilderFactory<MarkupTarget> {
override suspend fun drawOn(target: MarkupTarget, forPost: PostId) { override suspend fun drawOn(target: MarkupTarget, forPost: PostId) {
val post = postsRepo.getPostById(forPost) ?: return val post = postsRepo.getPostById(forPost) ?: return
val contents = post.content.mapNotNull { val contents = post.content.mapNotNull {

View File

@ -12,10 +12,10 @@ import com.insanusmokrassar.postssystem.core.post.PostId
* * Web * * Web
* * etc. * * etc.
* *
* [MarkupTarget] here is just a platform, which can be used by [MarkupCreator] to create markup inside. * [MarkupTarget] here is just a platform, which can be used by [MarkupBuilderFactory] to create markup inside.
* *
* For example, it could be some creator like "TelegramForHTMLMarkupBuilder" * For example, it could be some creator like "TelegramForHTMLMarkupBuilder"
*/ */
interface MarkupCreator<MarkupTarget> { interface MarkupBuilderFactory<MarkupTarget> {
suspend fun drawOn(target: MarkupTarget, forPost: PostId) suspend fun drawOn(target: MarkupTarget, forPost: PostId)
} }

View File

@ -2,10 +2,10 @@ package com.insanusmokrassar.postssystem.markups.html
import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo
import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo
import com.insanusmokrassar.postssystem.markups.core.AbstractMarkupCreator import com.insanusmokrassar.postssystem.markups.core.AbstractMarkupBuilderFactory
import kotlinx.html.FlowContent import kotlinx.html.FlowContent
abstract class HtmlMarkupCreator( abstract class HtmlMarkupBuilderFactory(
postsRepo: ReadPostsRepo, postsRepo: ReadPostsRepo,
postsContentRepo: ReadContentRepo postsContentRepo: ReadContentRepo
) : AbstractMarkupCreator<FlowContent>(postsRepo, postsContentRepo) ) : AbstractMarkupBuilderFactory<FlowContent>(postsRepo, postsContentRepo)

View File

@ -2,10 +2,10 @@ package com.insanusmokrassar.postssystem.markups.html
import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo
import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo
import com.insanusmokrassar.postssystem.markups.core.AbstractMarkupCreator import com.insanusmokrassar.postssystem.markups.core.AbstractMarkupBuilderFactory
import kotlinx.html.FlowContent import kotlinx.html.FlowContent
abstract class HtmlMarkupCreator( abstract class HtmlMarkupBuilderFactory(
postsRepo: ReadPostsRepo, postsRepo: ReadPostsRepo,
postsContentRepo: ReadContentRepo postsContentRepo: ReadContentRepo
) : AbstractMarkupCreator<FlowContent>(postsRepo, postsContentRepo) ) : AbstractMarkupBuilderFactory<FlowContent>(postsRepo, postsContentRepo)