2023-05-23 23:55:21 +08:00
|
|
|
use flowy_error::FlowyError;
|
2023-07-05 20:57:09 +08:00
|
|
|
use flowy_folder2::deps::{FolderCloudService, FolderSnapshot, Workspace};
|
2023-05-23 23:55:21 +08:00
|
|
|
use flowy_folder2::gen_workspace_id;
|
|
|
|
use lib_infra::future::FutureResult;
|
|
|
|
use lib_infra::util::timestamp;
|
|
|
|
|
|
|
|
pub(crate) struct LocalServerFolderCloudServiceImpl();
|
|
|
|
|
|
|
|
impl FolderCloudService for LocalServerFolderCloudServiceImpl {
|
|
|
|
fn create_workspace(&self, _uid: i64, name: &str) -> FutureResult<Workspace, FlowyError> {
|
|
|
|
let name = name.to_string();
|
|
|
|
FutureResult::new(async move {
|
|
|
|
Ok(Workspace {
|
|
|
|
id: gen_workspace_id(),
|
|
|
|
name: name.to_string(),
|
2023-05-31 17:42:14 +08:00
|
|
|
child_views: Default::default(),
|
2023-05-23 23:55:21 +08:00
|
|
|
created_at: timestamp(),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
2023-07-05 20:57:09 +08:00
|
|
|
|
|
|
|
fn get_folder_latest_snapshot(
|
|
|
|
&self,
|
|
|
|
_workspace_id: &str,
|
|
|
|
) -> FutureResult<Option<FolderSnapshot>, FlowyError> {
|
|
|
|
FutureResult::new(async move { Ok(None) })
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_folder_updates(&self, _workspace_id: &str) -> FutureResult<Vec<Vec<u8>>, FlowyError> {
|
|
|
|
FutureResult::new(async move { Ok(vec![]) })
|
|
|
|
}
|
2023-05-23 23:55:21 +08:00
|
|
|
}
|