- Removed blog router and associated API endpoints. - Deleted blog persistence functions and related query parameters. - Removed blog schemas and models from the codebase. - Introduced common crate for shared types, including DateTimeWithTimeZoneWrapper. - Added Thought and Follow models with corresponding migrations. - Updated dependencies in Cargo.toml files to reflect changes. - Adjusted tests to remove references to the blog module.
32 lines
703 B
Rust
32 lines
703 B
Rust
use axum::Router;
|
|
use utoipa::OpenApi;
|
|
use utoipa_scalar::{Scalar, Servable as ScalarServable};
|
|
use utoipa_swagger_ui::SwaggerUi;
|
|
|
|
mod root;
|
|
mod user;
|
|
|
|
#[derive(OpenApi)]
|
|
#[openapi(
|
|
nest(
|
|
(path = "/", api = root::RootApi),
|
|
(path = "/users", api = user::UserApi),
|
|
),
|
|
tags(
|
|
(name = "root", description = "Root API"),
|
|
(name = "user", description = "User API"),
|
|
)
|
|
)]
|
|
struct _ApiDoc;
|
|
|
|
pub trait ApiDoc {
|
|
fn attach_doc(self) -> Self;
|
|
}
|
|
|
|
impl ApiDoc for Router {
|
|
fn attach_doc(self) -> Self {
|
|
self.merge(SwaggerUi::new("/docs").url("/openapi.json", _ApiDoc::openapi()))
|
|
.merge(Scalar::with_url("/scalar", _ApiDoc::openapi()))
|
|
}
|
|
}
|