feat(search): add missing trait methods for mock repositories
- Add search_files_paginated and count_files to MockFileRepository in share_service.rs - Add search_files_paginated and count_files to MockFileRepository in trash_service_test.rs These methods were added to the FileReadPort trait to support database-level pagination for search optimization.
This commit is contained in:
@@ -483,6 +483,24 @@ mod tests {
|
|||||||
async fn get_blob_hash(&self, _file_id: &str) -> Result<String, DomainError> {
|
async fn get_blob_hash(&self, _file_id: &str) -> Result<String, DomainError> {
|
||||||
Ok(String::new())
|
Ok(String::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn search_files_paginated(
|
||||||
|
&self,
|
||||||
|
_folder_id: Option<&str>,
|
||||||
|
_criteria: &crate::application::dtos::search_dto::SearchCriteriaDto,
|
||||||
|
_user_id: &str,
|
||||||
|
) -> Result<(Vec<crate::domain::entities::file::File>, usize), DomainError> {
|
||||||
|
Ok((Vec::new(), 0))
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn count_files(
|
||||||
|
&self,
|
||||||
|
_folder_id: Option<&str>,
|
||||||
|
_criteria: &crate::application::dtos::search_dto::SearchCriteriaDto,
|
||||||
|
_user_id: &str,
|
||||||
|
) -> Result<usize, DomainError> {
|
||||||
|
Ok(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
|||||||
@@ -183,6 +183,24 @@ impl FileReadPort for MockFileRepository {
|
|||||||
async fn get_blob_hash(&self, _file_id: &str) -> std::result::Result<String, DomainError> {
|
async fn get_blob_hash(&self, _file_id: &str) -> std::result::Result<String, DomainError> {
|
||||||
Ok(String::new())
|
Ok(String::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn search_files_paginated(
|
||||||
|
&self,
|
||||||
|
_folder_id: Option<&str>,
|
||||||
|
_criteria: &crate::application::dtos::search_dto::SearchCriteriaDto,
|
||||||
|
_user_id: &str,
|
||||||
|
) -> std::result::Result<(Vec<File>, usize), DomainError> {
|
||||||
|
Ok((Vec::new(), 0))
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn count_files(
|
||||||
|
&self,
|
||||||
|
_folder_id: Option<&str>,
|
||||||
|
_criteria: &crate::application::dtos::search_dto::SearchCriteriaDto,
|
||||||
|
_user_id: &str,
|
||||||
|
) -> std::result::Result<usize, DomainError> {
|
||||||
|
Ok(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
|||||||
Reference in New Issue
Block a user