2025-04-14 10:36:42 +08:00
|
|
|
pub use client_api::entity::search_dto::{
|
|
|
|
SearchDocumentResponseItem, SearchResult, SearchSummaryResult,
|
|
|
|
};
|
2024-06-13 01:37:19 +02:00
|
|
|
use flowy_error::FlowyError;
|
|
|
|
use lib_infra::async_trait::async_trait;
|
2025-04-07 19:24:58 +08:00
|
|
|
use uuid::Uuid;
|
2024-06-13 01:37:19 +02:00
|
|
|
|
|
|
|
#[async_trait]
|
|
|
|
pub trait SearchCloudService: Send + Sync + 'static {
|
|
|
|
async fn document_search(
|
|
|
|
&self,
|
2025-04-07 19:24:58 +08:00
|
|
|
workspace_id: &Uuid,
|
2024-06-13 01:37:19 +02:00
|
|
|
query: String,
|
|
|
|
) -> Result<Vec<SearchDocumentResponseItem>, FlowyError>;
|
2025-04-14 10:36:42 +08:00
|
|
|
|
|
|
|
async fn generate_search_summary(
|
|
|
|
&self,
|
|
|
|
workspace_id: &Uuid,
|
|
|
|
query: String,
|
|
|
|
search_results: Vec<SearchResult>,
|
|
|
|
) -> Result<SearchSummaryResult, FlowyError>;
|
2024-06-13 01:37:19 +02:00
|
|
|
}
|