use std::sync::Arc; use collab_define::CollabObject; use collab_plugins::cloud_storage::RemoteCollabStorage; use flowy_database_deps::cloud::DatabaseCloudService; use flowy_document_deps::cloud::DocumentCloudService; use flowy_folder_deps::cloud::FolderCloudService; use flowy_storage::FileStorageService; use flowy_user_deps::cloud::UserCloudService; use crate::af_cloud::configuration::AFCloudConfiguration; use crate::af_cloud::impls::{ AFCloudDatabaseCloudServiceImpl, AFCloudDocumentCloudServiceImpl, AFCloudFolderCloudServiceImpl, AFCloudUserAuthServiceImpl, }; use crate::AppFlowyServer; pub struct AFCloudServer { pub(crate) config: AFCloudConfiguration, } impl AFCloudServer { pub fn new(config: AFCloudConfiguration) -> Self { Self { config } } } impl AppFlowyServer for AFCloudServer { fn user_service(&self) -> Arc { Arc::new(AFCloudUserAuthServiceImpl::new(self.config.clone())) } fn folder_service(&self) -> Arc { Arc::new(AFCloudFolderCloudServiceImpl()) } fn database_service(&self) -> Arc { Arc::new(AFCloudDatabaseCloudServiceImpl()) } fn document_service(&self) -> Arc { Arc::new(AFCloudDocumentCloudServiceImpl()) } fn collab_storage(&self, _collab_object: &CollabObject) -> Option> { None } fn file_storage(&self) -> Option> { None } }