Adding format to select between normal, clean and JSON. This needs some refactor
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct CurrentWeatherOutputModel {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub latitude: Option<f64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub longitude: Option<f64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub city: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub is_day: Option<i32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub temperature: Option<f64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub windspeed: Option<f64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub winddirection: Option<f64>,
|
||||
}
|
||||
|
||||
impl CurrentWeatherOutputModel {
|
||||
pub fn new() -> CurrentWeatherOutputModel {
|
||||
CurrentWeatherOutputModel {
|
||||
latitude: None,
|
||||
longitude: None,
|
||||
city: None,
|
||||
is_day: None,
|
||||
temperature: None,
|
||||
windspeed: None,
|
||||
winddirection: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user