start working on bar pinger and traewelling client
This commit is contained in:
parent
867514362a
commit
718fe00b46
13 changed files with 1062 additions and 48 deletions
47
programs/traveldings/src/traewelling/model.rs
Normal file
47
programs/traveldings/src/traewelling/model.rs
Normal file
|
@ -0,0 +1,47 @@
|
|||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct Container<D> {
|
||||
pub data: D,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Status {
|
||||
train: TransportResource,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct TransportResource {
|
||||
category: String,
|
||||
line_name: String,
|
||||
distance: u32,
|
||||
duration: u32,
|
||||
operator: OperatorResource,
|
||||
origin: StopOverResource,
|
||||
destination: StopOverResource,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct StopOverResource {
|
||||
name: String,
|
||||
ril_identifier: Option<String>,
|
||||
arrival: Option<DateTime<FixedOffset>>,
|
||||
arrival_planned: Option<DateTime<FixedOffset>>,
|
||||
arrival_real: Option<DateTime<FixedOffset>>,
|
||||
departure: Option<DateTime<FixedOffset>>,
|
||||
departure_planned: Option<DateTime<FixedOffset>>,
|
||||
departure_real: Option<DateTime<FixedOffset>>,
|
||||
platform: Option<String>,
|
||||
departure_platform_planned: Option<String>,
|
||||
departure_platform_real: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct OperatorResource {
|
||||
name: String,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue