pranksterlaborious受够了手写 rust axum API,我造了个轮子 中发帖

先声明:这帖子纯人工手打,绝非 AI 生成! 
搞了几个月 axum + utoipa 给我干麻了。
一个接口,到处注册:

axum 路由注册
utoipa 宏注解
OpenAPI 文档注册

写个宏写成这样:
#[utoipa::path(
get,
path = "/api/v1/stats/tcp",
responses(
(status = 200, description = "TCP statistics", body = ApiResponse),
),
tag = "Stats"
)]
pub async fn tcp(
State(_state): State>,
);

宏比我代码还多。
而且 utoipa 侵入性太强,写得我头疼。
axum 的路由注册也麻烦,需要把各个文件分散的函数注册到一起...