adding webdav features

This commit is contained in:
DioCrafts
2025-04-04 21:31:41 +02:00
parent e3256bb3b5
commit ba3ef2a530
21 changed files with 3358 additions and 960 deletions
+9
View File
@@ -23,6 +23,15 @@ pub trait FileUseCase: Send + Sync + 'static {
/// Obtiene un archivo por su ID
async fn get_file(&self, id: &str) -> Result<FileDto, DomainError>;
/// Obtiene un archivo por su ruta (para WebDAV)
async fn get_file_by_path(&self, path: &str) -> Result<FileDto, DomainError>;
/// Crea un nuevo archivo en la ruta especificada (para WebDAV)
async fn create_file(&self, parent_path: &str, filename: &str, content: &[u8], content_type: &str) -> Result<FileDto, DomainError>;
/// Actualiza el contenido de un archivo existente (para WebDAV)
async fn update_file(&self, path: &str, content: &[u8]) -> Result<(), DomainError>;
/// Lista archivos en una carpeta
async fn list_files(&self, folder_id: Option<&str>) -> Result<Vec<FileDto>, DomainError>;
+6
View File
@@ -56,6 +56,12 @@ pub trait FileStoragePort: Send + Sync + 'static {
/// Obtiene la ruta de almacenamiento de un archivo
async fn get_file_path(&self, id: &str) -> Result<StoragePath, DomainError>;
/// Obtiene el ID de la carpeta padre para una ruta dada (necesario para WebDAV)
async fn get_parent_folder_id(&self, path: &str) -> Result<String, DomainError>;
/// Actualiza el contenido de un archivo existente
async fn update_file_content(&self, file_id: &str, content: Vec<u8>) -> Result<(), DomainError>;
}
/// Puerto secundario para persistencia de carpetas