backend/model/dto/
base_layer_images.rs

1use serde::{Deserialize, Serialize};
2use typeshare::typeshare;
3use utoipa::ToSchema;
4use uuid::Uuid;
5
6/// Contains information about an image displayed on the base layer.
7#[typeshare]
8#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
9pub struct BaseLayerImageDto {
10    /// The id of the image.
11    pub id: Uuid,
12    /// The path to the image on Nextcloud.
13    pub path: String,
14    /// The rotation in degrees (0-360) of the image on the map.
15    pub rotation: f32,
16    /// The scale of the image on the map.
17    pub scale: f32,
18    /// The layer the image is on.
19    pub layer_id: Uuid,
20    /// The x coordinate of the position on the map.
21    pub x: i32,
22    /// The y coordinate of the position on the map.
23    pub y: i32,
24}
25
26/// Contains information for updating the `BaseLayerImage`.
27#[typeshare]
28#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
29pub struct UpdateBaseLayerImageDto {
30    /// The layer the image is on.
31    pub layer_id: Uuid,
32    /// The path to the image on Nextcloud.
33    pub path: String,
34    /// The rotation in degrees (0-360) of the image on the map.
35    pub rotation: f32,
36    /// The scale of the image on the map.
37    pub scale: f32,
38    /// The x coordinate of the position on the map.
39    pub x: i32,
40    /// The y coordinate of the position on the map.
41    pub y: i32,
42}
43
44/// Used to delete a base layer image.
45#[typeshare]
46#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
47#[serde(rename_all = "camelCase")]
48pub struct DeleteBaseLayerImageDto {
49    /// Id of the base layer image to delete.
50    pub id: Uuid,
51}