BLOG-56 refactor: rename as xxx_handler in routes #57

Open
squid wants to merge 3 commits from BLOG-56_align_clean_architecture into main
2 changed files with 3 additions and 5 deletions
Showing only changes of commit 1dc8ca742b - Show all commits

View File

@ -1,5 +1,3 @@
use std::sync::Arc;
use actix_web::{HttpResponse, Responder, web};
use crate::{
@ -16,7 +14,7 @@ pub fn configure_post_routes(cfg: &mut web::ServiceConfig) {
}
async fn get_all_post_info_handler(
post_controller: web::Data<Arc<dyn PostController>>,
post_controller: web::Data<dyn PostController>,
query: web::Query<PostQueryDto>,
) -> impl Responder {
let is_published_only = query.is_published_only.unwrap_or_else(|| true);
@ -32,7 +30,7 @@ async fn get_all_post_info_handler(
}
async fn get_full_post_handler(
post_controller: web::Data<Arc<dyn PostController>>,
post_controller: web::Data<dyn PostController>,
path: web::Path<i32>,
) -> impl Responder {
let id = path.into_inner();

View File

@ -55,6 +55,6 @@ fn create_app(
App::new()
.app_data(web::Data::new(db_pool))
.app_data(web::Data::new(container.post_controller))
.app_data(web::Data::from(container.post_controller))
.configure(configure_post_routes)
}