backend/model/dto/
base_layer_images_impl.rs1use uuid::Uuid;
4
5use crate::model::{
6 dto::base_layer_images::{BaseLayerImageDto, UpdateBaseLayerImageDto},
7 entity::base_layer_images::BaseLayerImages,
8};
9
10impl From<BaseLayerImages> for BaseLayerImageDto {
11 fn from(entity: BaseLayerImages) -> Self {
12 Self {
13 id: entity.id,
14 layer_id: entity.layer_id,
15 path: entity.path,
16 rotation: entity.rotation,
17 scale: entity.scale,
18 x: entity.x,
19 y: entity.y,
20 }
21 }
22}
23
24impl From<(Uuid, UpdateBaseLayerImageDto)> for BaseLayerImages {
25 fn from((id, dto): (Uuid, UpdateBaseLayerImageDto)) -> Self {
26 Self {
27 id,
28 layer_id: dto.layer_id,
29 path: dto.path,
30 rotation: dto.rotation,
31 scale: dto.scale,
32 x: dto.x,
33 y: dto.y,
34 }
35 }
36}
37
38impl From<BaseLayerImageDto> for BaseLayerImages {
39 fn from(dto: BaseLayerImageDto) -> Self {
40 Self {
41 id: dto.id,
42 layer_id: dto.layer_id,
43 path: dto.path,
44 rotation: dto.rotation,
45 scale: dto.scale,
46 x: dto.x,
47 y: dto.y,
48 }
49 }
50}