BLOG-125 Get post by sementic ID #134

Merged
squid merged 10 commits from BLOG-125_semantic_post_id into main 2025-10-12 18:28:58 +08:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 9862850d28 - Show all commits

View File

@ -15,12 +15,12 @@ pub trait GetPostBySemanticIdUseCase: Send + Sync {
async fn execute(&self, semantic_id: &str, user_id: Option<i32>) -> Result<Post, PostError>;
}
pub struct GetPostIdBySemanticIdUseCaseImpl {
pub struct GetPostBySemanticIdUseCaseImpl {
post_repository: Arc<dyn PostRepository>,
get_post_by_id_use_case: Arc<dyn GetPostByIdUseCase>,
}
impl GetPostIdBySemanticIdUseCaseImpl {
impl GetPostBySemanticIdUseCaseImpl {
pub fn new(
post_repository: Arc<dyn PostRepository>,
get_post_by_id_use_case: Arc<dyn GetPostByIdUseCase>,
@ -33,7 +33,7 @@ impl GetPostIdBySemanticIdUseCaseImpl {
}
#[async_trait]
impl GetPostBySemanticIdUseCase for GetPostIdBySemanticIdUseCaseImpl {
impl GetPostBySemanticIdUseCase for GetPostBySemanticIdUseCaseImpl {
async fn execute(&self, semantic_id: &str, user_id: Option<i32>) -> Result<Post, PostError> {
let id = self
.post_repository

View File

@ -40,7 +40,7 @@ use post::{
get_all_labels_use_case::GetAllLabelsUseCaseImpl,
get_all_post_info_use_case::GetAllPostInfoUseCaseImpl,
get_post_by_id_use_case::GetFullPostUseCaseImpl,
get_post_by_semantic_id_use_case::GetPostIdBySemanticIdUseCaseImpl,
get_post_by_semantic_id_use_case::GetPostBySemanticIdUseCaseImpl,
update_label_use_case::UpdateLabelUseCaseImpl, update_post_use_case::UpdatePostUseCaseImpl,
},
framework::db::{
@ -98,7 +98,7 @@ impl Container {
Arc::new(GetAllPostInfoUseCaseImpl::new(post_repository.clone()));
let get_post_by_id_use_case =
Arc::new(GetFullPostUseCaseImpl::new(post_repository.clone()));
let get_post_by_semantic_id_use_case = Arc::new(GetPostIdBySemanticIdUseCaseImpl::new(
let get_post_by_semantic_id_use_case = Arc::new(GetPostBySemanticIdUseCaseImpl::new(
post_repository.clone(),
get_post_by_id_use_case.clone(),
));