diff --git a/backend/feature/post/src/adapter/delivery/post_controller.rs b/backend/feature/post/src/adapter/delivery/post_controller.rs index 861bfb8..6ae8b68 100644 --- a/backend/feature/post/src/adapter/delivery/post_controller.rs +++ b/backend/feature/post/src/adapter/delivery/post_controller.rs @@ -1,5 +1,3 @@ -use std::sync::Arc; - use async_trait::async_trait; use crate::application::{ @@ -23,14 +21,14 @@ pub trait PostController: Send + Sync { } pub struct PostControllerImpl { - get_all_post_info_use_case: Arc, - get_full_post_use_case: Arc, + get_all_post_info_use_case: Box, + get_full_post_use_case: Box, } impl PostControllerImpl { pub fn new( - get_all_post_info_use_case: Arc, - get_full_post_use_case: Arc, + get_all_post_info_use_case: Box, + get_full_post_use_case: Box, ) -> Self { Self { get_all_post_info_use_case, @@ -45,7 +43,10 @@ impl PostController for PostControllerImpl { &self, is_published_only: bool, ) -> Result, PostError> { - let result = self.get_all_post_info_use_case.execute(is_published_only).await; + let result = self + .get_all_post_info_use_case + .execute(is_published_only) + .await; result.map(|post_info_list| { let post_info_response_dto_list: Vec = post_info_list diff --git a/backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs b/backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs index f2895d5..1084849 100644 --- a/backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs +++ b/backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs @@ -25,6 +25,8 @@ impl GetAllPostInfoUseCaseImpl { #[async_trait] impl GetAllPostInfoUseCase for GetAllPostInfoUseCaseImpl { async fn execute(&self, is_published_only: bool) -> Result, PostError> { - self.post_repository.get_all_post_info(is_published_only).await + self.post_repository + .get_all_post_info(is_published_only) + .await } } diff --git a/backend/server/src/container.rs b/backend/server/src/container.rs index b1558a0..7a689cc 100644 --- a/backend/server/src/container.rs +++ b/backend/server/src/container.rs @@ -24,8 +24,8 @@ impl Container { let post_repository = Arc::new(PostRepositoryImpl::new(post_db_service.clone())); let get_all_post_info_use_case = - Arc::new(GetAllPostInfoUseCaseImpl::new(post_repository.clone())); - let get_full_post_use_case = Arc::new(GetFullPostUseCaseImpl::new(post_repository.clone())); + Box::new(GetAllPostInfoUseCaseImpl::new(post_repository.clone())); + let get_full_post_use_case = Box::new(GetFullPostUseCaseImpl::new(post_repository.clone())); let post_controller = Arc::new(PostControllerImpl::new( get_all_post_info_use_case,