summaryrefslogtreecommitdiff
path: root/dichroism/src/dtos/photo_set_get.rs
blob: b2e8d7bbfbbe851ed6e773dd470bb9500892f370 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::models::PhotoSet;

#[derive(Debug, Serialize)]
pub struct PhotoSetGet {
    pub id: i32,
    pub fullsize: String,
    pub base: String,
    pub thumbnail: String,
}

impl From<PhotoSet> for PhotoSetGet {
    fn from(p: PhotoSet) -> Self {
        Self {
            id: p.id.unwrap_or(-1),
            fullsize: p.fullsize.id,
            base: p.base.id,
            thumbnail: p.thumbnail.id,
        }
    }
}