feat: implement friends API with routes to get friends list and update thought visibility logic
This commit is contained in:
12
thoughts-backend/doc/src/friends.rs
Normal file
12
thoughts-backend/doc/src/friends.rs
Normal 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;
|
@@ -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),
|
||||
)]
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user