postmasterlib/dto/
header_dto.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct HeaderDto {
    pub header_title: String,
    pub header_image: String,
    pub background: String,
}

impl HeaderDto {
    pub fn new(title: String, image: Option<String>, background: Option<String>) -> HeaderDto {
        HeaderDto {
            header_title: title,
            // todo temp solution
            header_image: image.unwrap_or("https://webschool.au/logo192.png".to_string()),//Брать из базы
            background: background.unwrap_or("linear-gradient(90deg, #1B0084, #00519b)".to_string()),
        }
    }
}