initial commit

This commit is contained in:
Joey Hines 2025-04-20 10:52:00 -06:00
commit 6b4a6d5f3a
Signed by: joeyahines
GPG Key ID: 38BA6F25C94C9382
2 changed files with 52 additions and 0 deletions

23
src/models/route.rs Normal file
View File

@ -0,0 +1,23 @@
use crate::models::Ctatt;
use crate::models::train::Train;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Debug)]
pub struct RouteRequest {
pub rt: String,
pub key: String,
}
#[derive(Deserialize, Debug)]
pub struct Route {
#[serde(rename = "@name")]
pub name: String,
pub train: Vec<Train>,
}
#[derive(Deserialize, Debug)]
pub struct RouteResp {
#[serde(flatten)]
pub header: Ctatt,
pub route: Vec<Route>,
}

29
src/models/train.rs Normal file
View File

@ -0,0 +1,29 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub struct Train {
pub rn: String,
#[serde(rename = "destSt")]
pub dest_st: String,
#[serde(rename = "destNm")]
pub dest_nm: String,
#[serde(rename = "trDr")]
pub tr_dr: String,
#[serde(rename = "nextStaId")]
pub next_sta_id: String,
#[serde(rename = "nextStpId")]
pub next_stp_id: String,
#[serde(rename = "nextStaNm")]
pub next_sta_nm: String,
pub prdt: String,
#[serde(rename = "arrT")]
pub arrt: String,
#[serde(rename = "isApp")]
pub is_app: String,
#[serde(rename = "isDly")]
pub is_dly: String,
pub flags: Option<String>,
pub lat: String,
pub lon: String,
pub heading: String,
}