backend/model/dto/
base_layer_images_impl.rsuse uuid::Uuid;
use crate::model::{
dto::base_layer_images::{BaseLayerImageDto, UpdateBaseLayerImageDto},
entity::base_layer_images::BaseLayerImages,
};
impl From<BaseLayerImages> for BaseLayerImageDto {
fn from(entity: BaseLayerImages) -> Self {
Self {
id: entity.id,
layer_id: entity.layer_id,
path: entity.path,
rotation: entity.rotation,
scale: entity.scale,
x: entity.x,
y: entity.y,
}
}
}
impl From<(Uuid, UpdateBaseLayerImageDto)> for BaseLayerImages {
fn from((id, dto): (Uuid, UpdateBaseLayerImageDto)) -> Self {
Self {
id,
layer_id: dto.layer_id,
path: dto.path,
rotation: dto.rotation,
scale: dto.scale,
x: dto.x,
y: dto.y,
}
}
}
impl From<BaseLayerImageDto> for BaseLayerImages {
fn from(dto: BaseLayerImageDto) -> Self {
Self {
id: dto.id,
layer_id: dto.layer_id,
path: dto.path,
rotation: dto.rotation,
scale: dto.scale,
x: dto.x,
y: dto.y,
}
}
}