Skip to content

Commit

Permalink
Revert struct fields privacy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lun4m committed Jul 3, 2024
1 parent 11a656d commit bfba2b3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions api/src/latest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
pub struct LatestElem {
pub value: f32,
pub timestamp: DateTime<Utc>,
pub station_id: i32,
pub loc: Option<Location>,
value: f32,
timestamp: DateTime<Utc>,
station_id: i32,
loc: Option<Location>,
}

pub async fn get_latest(
Expand Down
20 changes: 10 additions & 10 deletions api/src/timeseries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ pub struct TimeseriesInfo {
pub ts_id: i32,
pub fromtime: DateTime<Utc>,
pub totime: DateTime<Utc>,
pub station_id: i32,
pub param_id: i32,
pub lvl: Option<i32>,
pub sensor: Option<i32>,
pub location: Option<Location>,
station_id: i32,
param_id: i32,
lvl: Option<i32>,
sensor: Option<i32>,
location: Option<Location>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct TimeseriesIrregular {
pub header: TimeseriesInfo,
pub data: Vec<f32>,
pub timestamps: Vec<DateTime<Utc>>,
header: TimeseriesInfo,
timestamps: Vec<DateTime<Utc>>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct TimeseriesRegular {
pub header: TimeseriesInfo,
pub data: Vec<Option<f32>>,
pub start_time: DateTime<Utc>,
pub time_resolution: String,
header: TimeseriesInfo,
start_time: DateTime<Utc>,
time_resolution: String,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
4 changes: 2 additions & 2 deletions api/src/timeslice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
pub struct TimesliceElem {
pub value: f32,
pub station_id: i32,
value: f32,
// TODO: this shouldn't be an Option, but it avoids panics if location is somehow
// not found in the database
pub loc: Option<Location>,
loc: Option<Location>,
}

// TODO: consider whether this should be object-of-arrays style
Expand Down

0 comments on commit bfba2b3

Please sign in to comment.