feat(domain): SearchPort trait with thought and user search
This commit is contained in:
@@ -136,3 +136,21 @@ pub trait FeedRepository: Send + Sync {
|
||||
async fn public_feed(&self, page: &PageParams, viewer_id: Option<&UserId>) -> Result<Paginated<FeedEntry>, DomainError>;
|
||||
async fn search(&self, query: &str, page: &PageParams, viewer_id: Option<&UserId>) -> Result<Paginated<FeedEntry>, DomainError>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait SearchPort: Send + Sync {
|
||||
/// Full-text search over public thoughts, ranked by trigram similarity.
|
||||
async fn search_thoughts(
|
||||
&self,
|
||||
query: &str,
|
||||
page: &PageParams,
|
||||
viewer_id: Option<&UserId>,
|
||||
) -> Result<Paginated<FeedEntry>, DomainError>;
|
||||
|
||||
/// Search users by username or display_name, ranked by trigram similarity.
|
||||
async fn search_users(
|
||||
&self,
|
||||
query: &str,
|
||||
page: &PageParams,
|
||||
) -> Result<Paginated<User>, DomainError>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user