feat: implement friends API with routes to get friends list and update thought visibility logic

This commit is contained in:
2025-09-06 22:14:47 +02:00
parent bf7c6501c6
commit dc92945962
11 changed files with 241 additions and 11 deletions

View File

@@ -0,0 +1,12 @@
use utoipa::OpenApi;
use api::models::{ApiErrorResponse, ParamsErrorResponse};
use api::routers::friends::*;
use models::schemas::user::{UserListSchema, UserSchema};
#[derive(OpenApi)]
#[openapi(
paths(get_friends_list,),
components(schemas(UserListSchema, ApiErrorResponse, ParamsErrorResponse, UserSchema))
)]
pub(super) struct FriendsApi;

View File

@@ -9,6 +9,7 @@ use utoipa_swagger_ui::SwaggerUi;
mod api_key;
mod auth;
mod feed;
mod friends;
mod root;
mod tag;
mod thought;
@@ -24,6 +25,7 @@ mod user;
(path = "/thoughts", api = thought::ThoughtApi),
(path = "/feed", api = feed::FeedApi),
(path = "/tags", api = tag::TagApi),
(path = "/friends", api = friends::FriendsApi),
),
tags(
(name = "root", description = "Root API"),
@@ -32,6 +34,7 @@ mod user;
(name = "thought", description = "Thoughts API"),
(name = "feed", description = "Feed API"),
(name = "tag", description = "Tag Discovery API"),
(name = "friends", description = "Friends API"),
),
modifiers(&SecurityAddon),
)]

View File

@@ -7,7 +7,7 @@ use utoipa::OpenApi;
#[derive(OpenApi)]
#[openapi(
paths(thoughts_post, thoughts_delete),
paths(thoughts_post, thoughts_delete, get_thought_by_id),
components(schemas(
CreateThoughtParams,
ThoughtSchema,