mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3444 Chats | Enhancement | Bookmark flow updates (#2399)
This commit is contained in:
parent
191b675fc9
commit
1d8501f7a0
20 changed files with 282 additions and 15 deletions
|
@ -14,6 +14,7 @@ import com.anytypeio.anytype.core_models.DeviceNetworkType
|
|||
import com.anytypeio.anytype.core_models.Event
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.Key
|
||||
import com.anytypeio.anytype.core_models.LinkPreview
|
||||
import com.anytypeio.anytype.core_models.ManifestInfo
|
||||
import com.anytypeio.anytype.core_models.NodeUsageInfo
|
||||
import com.anytypeio.anytype.core_models.ObjectType
|
||||
|
@ -519,4 +520,8 @@ interface BlockRepository {
|
|||
suspend fun objectTypeSetRecommendedFields(command: Command.ObjectTypeSetRecommendedFields)
|
||||
|
||||
suspend fun setDataViewProperties(command: Command.SetDataViewProperties): Payload
|
||||
|
||||
suspend fun getLinkPreview(url: Url): LinkPreview
|
||||
|
||||
suspend fun createObjectFromUrl(space: SpaceId, url: Url): ObjectWrapper.Basic
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.anytypeio.anytype.domain.misc
|
||||
|
||||
import com.anytypeio.anytype.core_models.LinkPreview
|
||||
import com.anytypeio.anytype.core_models.Url
|
||||
import com.anytypeio.anytype.domain.base.AppCoroutineDispatchers
|
||||
import com.anytypeio.anytype.domain.base.ResultInteractor
|
||||
import com.anytypeio.anytype.domain.block.repo.BlockRepository
|
||||
import javax.inject.Inject
|
||||
|
||||
class GetLinkPreview @Inject constructor(
|
||||
private val repo: BlockRepository,
|
||||
dispatchers: AppCoroutineDispatchers
|
||||
) : ResultInteractor<Url, LinkPreview>(dispatchers.io) {
|
||||
override suspend fun doWork(params: Url): LinkPreview {
|
||||
return repo.getLinkPreview(url = params)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.anytypeio.anytype.domain.objects
|
||||
|
||||
import com.anytypeio.anytype.core_models.ObjectWrapper
|
||||
import com.anytypeio.anytype.core_models.Url
|
||||
import com.anytypeio.anytype.core_models.primitives.SpaceId
|
||||
import com.anytypeio.anytype.domain.base.AppCoroutineDispatchers
|
||||
import com.anytypeio.anytype.domain.base.ResultInteractor
|
||||
import com.anytypeio.anytype.domain.block.repo.BlockRepository
|
||||
import javax.inject.Inject
|
||||
|
||||
class CreateObjectFromUrl @Inject constructor(
|
||||
private val repository: BlockRepository,
|
||||
dispatchers: AppCoroutineDispatchers
|
||||
) : ResultInteractor<CreateObjectFromUrl.Params, ObjectWrapper.Basic>(dispatchers.io) {
|
||||
|
||||
override suspend fun doWork(params: Params): ObjectWrapper.Basic {
|
||||
return repository.createObjectFromUrl(
|
||||
space = params.space,
|
||||
url = params.url
|
||||
)
|
||||
}
|
||||
|
||||
data class Params(
|
||||
val space: SpaceId,
|
||||
val url: Url
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue