adding webdav features
This commit is contained in:
@@ -482,6 +482,14 @@ impl Default for AppState {
|
||||
async fn get_file_path(&self, _id: &str) -> Result<crate::domain::services::path_service::StoragePath, crate::common::errors::DomainError> {
|
||||
Ok(crate::domain::services::path_service::StoragePath::from_string("/"))
|
||||
}
|
||||
|
||||
async fn get_parent_folder_id(&self, _path: &str) -> Result<String, crate::common::errors::DomainError> {
|
||||
Ok("root".to_string())
|
||||
}
|
||||
|
||||
async fn update_file_content(&self, _file_id: &str, _content: Vec<u8>) -> Result<(), crate::common::errors::DomainError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
struct DummyFolderStoragePort;
|
||||
@@ -618,6 +626,18 @@ impl Default for AppState {
|
||||
Ok(crate::application::dtos::file_dto::FileDto::default())
|
||||
}
|
||||
|
||||
async fn get_file_by_path(&self, _path: &str) -> Result<crate::application::dtos::file_dto::FileDto, crate::common::errors::DomainError> {
|
||||
Ok(crate::application::dtos::file_dto::FileDto::default())
|
||||
}
|
||||
|
||||
async fn create_file(&self, _parent_path: &str, _filename: &str, _content: &[u8], _content_type: &str) -> Result<crate::application::dtos::file_dto::FileDto, crate::common::errors::DomainError> {
|
||||
Ok(crate::application::dtos::file_dto::FileDto::default())
|
||||
}
|
||||
|
||||
async fn update_file(&self, _path: &str, _content: &[u8]) -> Result<(), crate::common::errors::DomainError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn list_files(&self, _folder_id: Option<&str>) -> Result<Vec<crate::application::dtos::file_dto::FileDto>, crate::common::errors::DomainError> {
|
||||
Ok(Vec::new())
|
||||
}
|
||||
|
||||
@@ -285,6 +285,18 @@ impl AppError {
|
||||
pub fn internal_error(message: impl Into<String>) -> Self {
|
||||
Self::new(axum::http::StatusCode::INTERNAL_SERVER_ERROR, message, "InternalError")
|
||||
}
|
||||
|
||||
pub fn method_not_allowed(message: impl Into<String>) -> Self {
|
||||
Self::new(axum::http::StatusCode::METHOD_NOT_ALLOWED, message, "MethodNotAllowed")
|
||||
}
|
||||
|
||||
pub fn conflict(message: impl Into<String>) -> Self {
|
||||
Self::new(axum::http::StatusCode::CONFLICT, message, "Conflict")
|
||||
}
|
||||
|
||||
pub fn unsupported_media_type(message: impl Into<String>) -> Self {
|
||||
Self::new(axum::http::StatusCode::UNSUPPORTED_MEDIA_TYPE, message, "UnsupportedMediaType")
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DomainError> for AppError {
|
||||
|
||||
Reference in New Issue
Block a user