2024-10-03 23:45:29 +08:00
|
|
|
use collab_folder::hierarchy_builder::ParentChildViews;
|
2024-01-12 14:34:59 +08:00
|
|
|
use flowy_error::FlowyResult;
|
2024-10-06 20:08:17 +08:00
|
|
|
use flowy_folder_pub::entities::ImportFrom;
|
2024-01-12 14:34:59 +08:00
|
|
|
use lib_infra::async_trait::async_trait;
|
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
#[async_trait]
|
|
|
|
pub trait UserWorkspaceService: Send + Sync {
|
2024-10-06 20:08:17 +08:00
|
|
|
async fn import_views(
|
|
|
|
&self,
|
|
|
|
source: &ImportFrom,
|
|
|
|
views: Vec<ParentChildViews>,
|
|
|
|
orphan_views: Vec<ParentChildViews>,
|
|
|
|
parent_view_id: Option<String>,
|
|
|
|
) -> FlowyResult<()>;
|
|
|
|
async fn import_database_views(
|
2024-01-12 14:34:59 +08:00
|
|
|
&self,
|
|
|
|
ids_by_database_id: HashMap<String, Vec<String>>,
|
|
|
|
) -> FlowyResult<()>;
|
2024-06-05 13:44:32 +02:00
|
|
|
|
|
|
|
/// Removes local indexes when a workspace is left/deleted
|
|
|
|
fn did_delete_workspace(&self, workspace_id: String) -> FlowyResult<()>;
|
2024-01-12 14:34:59 +08:00
|
|
|
}
|