BLOG-56 refactor: rename as xxx_handler in routes
Some checks failed
Frontend CI / build (push) Successful in 1m27s
PR Title Check / pr-title-check (pull_request) Failing after 16s

This commit is contained in:
Yu Squire[ Yu, Tsung-Ying ] 2025-07-01 11:33:13 +08:00
parent c39a800b6b
commit 9dcefe90c5

View File

@ -8,11 +8,14 @@ use crate::{
};
pub fn configure_post_routes(cfg: &mut web::ServiceConfig) {
cfg.service(web::resource("/post_info").route(web::get().to(get_all_post_info)));
cfg.service(web::resource("/post/{id}").route(web::get().to(get_full_post)));
cfg.service(
web::scope("/post")
.route("/all", web::get().to(get_all_post_info_handler))
.route("/{id}", web::get().to(get_full_post_handler)),
);
}
async fn get_all_post_info(
async fn get_all_post_info_handler(
post_controller: web::Data<Arc<dyn PostController>>,
query: web::Query<PostQueryDto>,
) -> impl Responder {
@ -28,7 +31,7 @@ async fn get_all_post_info(
}
}
async fn get_full_post(
async fn get_full_post_handler(
post_controller: web::Data<Arc<dyn PostController>>,
path: web::Path<i32>,
) -> impl Responder {