feat: implement full-text search functionality with API integration, add search router and persistence logic, and create related schemas and tests

This commit is contained in:
2025-09-07 12:36:03 +02:00
parent c3539cfc11
commit 69eb225c1e
15 changed files with 409 additions and 2 deletions

View File

@@ -11,10 +11,10 @@ mod auth;
mod feed;
mod friends;
mod root;
mod search;
mod tag;
mod thought;
mod user;
#[derive(OpenApi)]
#[openapi(
nest(
@@ -26,6 +26,7 @@ mod user;
(path = "/feed", api = feed::FeedApi),
(path = "/tags", api = tag::TagApi),
(path = "/friends", api = friends::FriendsApi),
(path = "/search", api = search::SearchApi),
),
tags(
(name = "root", description = "Root API"),
@@ -35,6 +36,7 @@ mod user;
(name = "feed", description = "Feed API"),
(name = "tag", description = "Tag Discovery API"),
(name = "friends", description = "Friends API"),
(name = "search", description = "Search API"),
),
modifiers(&SecurityAddon),
)]

View File

@@ -0,0 +1,21 @@
use api::{models::ApiErrorResponse, routers::search::*};
use models::schemas::{
search::SearchResultsSchema,
thought::{ThoughtListSchema, ThoughtSchema},
user::{UserListSchema, UserSchema},
};
use utoipa::OpenApi;
#[derive(OpenApi)]
#[openapi(
paths(search_all),
components(schemas(
SearchResultsSchema,
ApiErrorResponse,
ThoughtSchema,
ThoughtListSchema,
UserSchema,
UserListSchema
))
)]
pub(super) struct SearchApi;