From cc5a49843630c10b733d5113269502b68aec9787 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 1 Dec 2020 12:43:12 +0600 Subject: [PATCH] update BusinessContentRepo to reuse content id from link to content --- PostsSystem.drawio | 2 +- .../dev/inmo/postssystem/core/content/Content.kt | 8 ++++---- .../content/api/business/BusinessContentRepo.kt | 8 ++++++++ .../core/publishing/PublishingTrigger.kt | 13 +++++-------- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/PostsSystem.drawio b/PostsSystem.drawio index fcde3ee4..249a1430 100644 --- a/PostsSystem.drawio +++ b/PostsSystem.drawio @@ -1 +1 @@ -7V1dl5o4GP41ntO9mB4+BJ3LGTttz9nt2W7t6baXETLCisQDsTP212+iRCBRxBF4Q8e5aCUmSB6e9zNvYGBPls8fErQKPhEfRwPL8J8H9ruBxf5GFvuPt2x2LWNztGuYJ6G/azLzhmn4C2eNRta6Dn2cljpSQiIarsqNHolj7NFSG0oS8lTu9kii8q+u0BwrDVMPRWrrv6FPg2wWjpG3f8ThPBC/bBrZN0skOmcNaYB88lRosh8G9iQhhO4+LZ8nOOLgCVx2494f+XZ/YQmOaZ0Bvz4u/vnmIuTd/Nisv0cBQXRyY+/O8hNF62zC2cXSjUAA+wyQ7JAkNCBzEqPoIW+9T8g69jH/GYMd5X3+ImTFGk3W+B+mdJPdXbSmhDUFdBll36pTyWaXknXi4YrrF5RAyRzTin7ZtPhcCj+QAfUBkyWmyYZ1SHCEaPizfPNRxqH5vl8OM/uQIX0G6s4rQX2oFeqmgvpnktJ0ukkpXio3IIeXY/UUhBRPV2gLyxNTdTWh/IkTip8rJ599aws9kSnKYXb4lGsdU3QJChrHNVqCa9Rzklo1SepqRdLxFXUA1G+vqEMoZAMCZQZusvnOx791xOGP7HTbg3fPpaNNdtT+3THNpm9PNvQzCdk1HzU11liyIbsrzUZJN3l/GS+/75YibffIW+DYV+hwwuyWbXQDRtiSkDHBrbC4AGDVlDJK0DseT7GGmMRYtL0P+XwycfF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L+w/26qIYZoTyeo+oiI7clOLQynpAZo9Cm0i5BxbFHqtqhxcaDWLaUotrrLSnLJwh6CfiU/K0htBxgvVGilRf038gHcJIXlLFjemcGDJmS9dWlv3S35HKJxdln9RKctqlH+Yynr/fw== \ No newline at end of file diff --git a/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/Content.kt b/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/Content.kt index ff10e7a4..2f54b95a 100644 --- a/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/Content.kt +++ b/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/Content.kt @@ -14,12 +14,12 @@ typealias ContentId = String interface Content /** - * It is content, which was added by some external source to use inside of some plugins. For example, you can use - * location as content inside your target system and add this type of content specially for this system only + * That is a content which in fact just a link to another content. It would be useful in case when user wish to reuse + * some content */ @Serializable -data class SpecialContent( - val internalId: ContentId +data class OtherContentLinkContent( + val otherId: ContentId ) : Content diff --git a/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/api/business/BusinessContentRepo.kt b/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/api/business/BusinessContentRepo.kt index 5d73ff13..22d13c10 100644 --- a/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/api/business/BusinessContentRepo.kt +++ b/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/api/business/BusinessContentRepo.kt @@ -59,6 +59,14 @@ class BusinessWriteContentRepo( override suspend fun create(values: List): List { return values.mapNotNull { content -> + if (content is OtherContentLinkContent) { + adapters.forEach { + return@mapNotNull RegisteredContent( + content.otherId, + it.getContent(content.otherId) ?: return@forEach + ) + } + } val contentId = generateContentId() val adapter = adapters.firstOrNull { it.storeContent(contentId, content) } ?: return@mapNotNull null if (!helperRepo.saveType(contentId, adapter.type)) { diff --git a/publishing/api/src/commonMain/kotlin/dev/inmo/postssystem/core/publishing/PublishingTrigger.kt b/publishing/api/src/commonMain/kotlin/dev/inmo/postssystem/core/publishing/PublishingTrigger.kt index 921f978e..dfdbdc08 100644 --- a/publishing/api/src/commonMain/kotlin/dev/inmo/postssystem/core/publishing/PublishingTrigger.kt +++ b/publishing/api/src/commonMain/kotlin/dev/inmo/postssystem/core/publishing/PublishingTrigger.kt @@ -5,13 +5,10 @@ import dev.inmo.postssystem.core.post.RegisteredPost import dev.inmo.postssystem.core.post.repo.PostsRepo import dev.inmo.postssystem.core.publishing.repos.PublishedPostsWriteRepo import dev.inmo.postssystem.core.publishing.repos.PublishingKeysRepo -import kotlinx.coroutines.channels.BroadcastChannel -import kotlinx.coroutines.channels.Channel -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.asFlow +import kotlinx.coroutines.flow.* interface PublishingTrigger { - val postingTriggeredFlow: Flow + val postingTriggeredFlow: SharedFlow suspend fun triggerPosting( triggerControlKey: TriggerControlKey @@ -23,8 +20,8 @@ class BusinessPublishingTrigger( private val publishedPostsRepo: PublishedPostsWriteRepo, private val publishingKeysRepo: PublishingKeysRepo ) : PublishingTrigger { - private val postingTriggeredChannel: BroadcastChannel = BroadcastChannel(Channel.BUFFERED) - override val postingTriggeredFlow: Flow = postingTriggeredChannel.asFlow() + private val _postingTriggeredFlow: MutableSharedFlow = MutableSharedFlow() + override val postingTriggeredFlow: SharedFlow = _postingTriggeredFlow.asSharedFlow() override suspend fun triggerPosting(triggerControlKey: TriggerControlKey): PostId? { val postId = publishingKeysRepo.getPostIdByTriggerControlKey(triggerControlKey) ?: return null @@ -33,7 +30,7 @@ class BusinessPublishingTrigger( return postsRepo.getPostById(postId) ?.let { post -> publishedPostsRepo.registerPublishedPost(post) ?.let { publishedPost -> if (postsRepo.deletePost(postId)) { - postingTriggeredChannel.send(post) + _postingTriggeredFlow.emit(post) postId } else { publishedPostsRepo.unpublishPost(publishedPost.id)