2023-05-23 15:55:21 +00:00
|
|
|
use flowy_folder2::deps::FolderCloudService;
|
2023-05-21 10:53:59 +00:00
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
|
|
use flowy_user::event_map::UserAuthService;
|
|
|
|
|
|
|
|
use crate::self_host::configuration::SelfHostedConfiguration;
|
2023-05-23 15:55:21 +00:00
|
|
|
use crate::self_host::impls::{
|
|
|
|
SelfHostedServerFolderCloudServiceImpl, SelfHostedUserAuthServiceImpl,
|
|
|
|
};
|
2023-05-21 10:53:59 +00:00
|
|
|
use crate::AppFlowyServer;
|
|
|
|
|
|
|
|
pub struct SelfHostServer {
|
|
|
|
pub(crate) config: SelfHostedConfiguration,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SelfHostServer {
|
|
|
|
pub fn new(config: SelfHostedConfiguration) -> Self {
|
|
|
|
Self { config }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl AppFlowyServer for SelfHostServer {
|
|
|
|
fn user_service(&self) -> Arc<dyn UserAuthService> {
|
|
|
|
Arc::new(SelfHostedUserAuthServiceImpl::new(self.config.clone()))
|
|
|
|
}
|
2023-05-23 15:55:21 +00:00
|
|
|
|
|
|
|
fn folder_service(&self) -> Arc<dyn FolderCloudService> {
|
|
|
|
Arc::new(SelfHostedServerFolderCloudServiceImpl())
|
|
|
|
}
|
2023-05-21 10:53:59 +00:00
|
|
|
}
|