adding recent feature + bug fixed
This commit is contained in:
+13
-1
@@ -22,6 +22,7 @@ use crate::application::services::storage_mediator::{StorageMediator, FileSystem
|
||||
use crate::application::ports::inbound::{FileUseCase, FolderUseCase, SearchUseCase};
|
||||
use crate::application::ports::outbound::{FileStoragePort, FolderStoragePort};
|
||||
use crate::application::ports::favorites_ports::FavoritesUseCase;
|
||||
use crate::application::ports::recent_ports::RecentItemsUseCase;
|
||||
use crate::application::ports::file_ports::{FileUploadUseCase, FileRetrievalUseCase, FileManagementUseCase, FileUseCaseFactory};
|
||||
use crate::application::ports::storage_ports::{FileReadPort, FileWritePort};
|
||||
use crate::infrastructure::repositories::{FileMetadataManager, FilePathResolver, FileFsReadRepository, FileFsWriteRepository};
|
||||
@@ -241,7 +242,8 @@ impl AppServiceFactory {
|
||||
trash_service,
|
||||
search_service,
|
||||
share_service: None, // No share service by default
|
||||
favorites_service: None // No favorites service by default
|
||||
favorites_service: None, // No favorites service by default
|
||||
recent_service: None // No recent service by default
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -286,6 +288,7 @@ pub struct ApplicationServices {
|
||||
pub search_service: Option<Arc<dyn SearchUseCase>>,
|
||||
pub share_service: Option<Arc<dyn crate::application::ports::share_ports::ShareUseCase>>,
|
||||
pub favorites_service: Option<Arc<dyn FavoritesUseCase>>,
|
||||
pub recent_service: Option<Arc<dyn RecentItemsUseCase>>,
|
||||
}
|
||||
|
||||
/// Contenedor para servicios de autenticación
|
||||
@@ -307,6 +310,7 @@ pub struct AppState {
|
||||
pub trash_service: Option<Arc<dyn TrashUseCase>>,
|
||||
pub share_service: Option<Arc<dyn crate::application::ports::share_ports::ShareUseCase>>,
|
||||
pub favorites_service: Option<Arc<dyn FavoritesUseCase>>,
|
||||
pub recent_service: Option<Arc<dyn RecentItemsUseCase>>,
|
||||
}
|
||||
|
||||
impl Default for AppState {
|
||||
@@ -777,6 +781,7 @@ impl Default for AppState {
|
||||
search_service: Some(Arc::new(DummySearchUseCase) as Arc<dyn crate::application::ports::inbound::SearchUseCase>),
|
||||
share_service: None, // No share service in minimal mode
|
||||
favorites_service: None, // No favorites service in minimal mode
|
||||
recent_service: None, // No recent service in minimal mode
|
||||
};
|
||||
|
||||
// Return a minimal app state
|
||||
@@ -789,6 +794,7 @@ impl Default for AppState {
|
||||
trash_service: None,
|
||||
share_service: None,
|
||||
favorites_service: None,
|
||||
recent_service: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -808,6 +814,7 @@ impl AppState {
|
||||
trash_service: None,
|
||||
share_service: None,
|
||||
favorites_service: None,
|
||||
recent_service: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -835,4 +842,9 @@ impl AppState {
|
||||
self.favorites_service = Some(favorites_service);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_recent_service(mut self, recent_service: Arc<dyn RecentItemsUseCase>) -> Self {
|
||||
self.recent_service = Some(recent_service);
|
||||
self
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user