bioscopelib/dto/
picture_response.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//!
//!`Picture` response to client
//!
use crate::jsonb::picture_data::PictureData;
use chrono::NaiveDateTime;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct PictureResponse {
    /// Picture ID
    pub id: Uuid,

    /// ID of the microscope that took the photo
    pub microscope: Uuid,

    /// The user who requested picture (picture can be receive without user request)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user: Option<Uuid>,

    /// Last update date (date when the picture was took)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub date: Option<NaiveDateTime>,

    /// Path of the photo on the server
    pub path: String,

    /// Info about picture
    #[serde(skip_serializing_if = "Option::is_none")]
    pub content: Option<PictureData>,
}