blog/backend/feature/post/src/adapter/gateway/post_db_mapper.rs
SquidSpirit 7b431e3fc8
All checks were successful
Frontend CI / build (push) Successful in 1m5s
BLOG-78 refactor: rename db mapper
2025-07-26 09:12:41 +08:00

18 lines
394 B
Rust

use crate::{adapter::gateway::post_info_db_mapper::PostInfoMapper, domain::entity::post::Post};
pub struct PostMapper {
pub id: i32,
pub info: PostInfoMapper,
pub content: String,
}
impl PostMapper {
pub fn to_entity(&self) -> Post {
Post {
id: self.id,
info: self.info.to_entity(),
content: self.content.clone(),
}
}
}