blog/backend/feature/post/src/adapter/controller/label_response_dto.rs
SquidSpirit c08bc659b9
All checks were successful
Frontend CI / build (push) Successful in 1m29s
BLOG-43 feat: post info usecase
2025-05-05 06:40:03 +08:00

21 lines
386 B
Rust

use serde::Serialize;
use crate::domain::entity::label::Label;
#[derive(Serialize)]
pub struct LabelResponseDto {
pub id: u32,
pub name: String,
pub color: String,
}
impl From<Label> for LabelResponseDto {
fn from(entity: Label) -> Self {
Self {
id: entity.id,
name: entity.name,
color: entity.color,
}
}
}