feat: add documentation crate and integrate OpenAPI specifications
- Added a new crate `doc` for API documentation. - Integrated `utoipa` for OpenAPI support in the presentation layer. - Updated routes to include social features (follow, unfollow, etc.) and diary export. - Enhanced API request and response structures with new DTOs for social interactions. - Updated `Cargo.toml` files to include new dependencies and features. - Modified Dockerfile to copy the new documentation crate. - Refactored existing handlers and routes to accommodate new API endpoints. - Updated tests to cover new functionality and ensure proper API behavior.
This commit is contained in:
@@ -176,6 +176,13 @@ fn api_routes(rate_limit: u64) -> Router<AppState> {
|
||||
.route("/auth/login", routing::post(handlers::api::login))
|
||||
.route("/auth/register", routing::post(handlers::api::register))
|
||||
.route("/diary/export", routing::get(handlers::api::export_diary))
|
||||
.route("/social/following", routing::get(handlers::api::get_following))
|
||||
.route("/social/followers", routing::get(handlers::api::get_followers))
|
||||
.route("/social/follow", routing::post(handlers::api::follow))
|
||||
.route("/social/unfollow", routing::post(handlers::api::unfollow))
|
||||
.route("/social/followers/accept", routing::post(handlers::api::accept_follower))
|
||||
.route("/social/followers/reject", routing::post(handlers::api::reject_follower))
|
||||
.route("/social/followers/remove", routing::post(handlers::api::remove_follower))
|
||||
.route_layer(auth_rate_limit),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user