-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
editoast: split track section endpoint
- Loading branch information
Showing
15 changed files
with
1,104 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
editoast/src/infra_cache/object_cache/neutral_section_cache.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use crate::infra_cache::Cache; | ||
use crate::infra_cache::ObjectCache; | ||
use editoast_schemas::infra::NeutralSection; | ||
|
||
impl Cache for NeutralSection { | ||
fn get_track_referenced_id(&self) -> Vec<&String> { | ||
let mut res: Vec<_> = self.track_ranges.iter().map(|tr| &*tr.track).collect(); | ||
res.extend(self.announcement_track_ranges.iter().map(|tr| &*tr.track)); | ||
if let Some(ext) = &self.extensions.neutral_sncf { | ||
res.push(&*ext.exe.track); | ||
res.extend(ext.announcement.iter().map(|sign| &*sign.track)); | ||
res.extend(ext.end.iter().map(|sign| &*sign.track)); | ||
res.extend(ext.rev.iter().map(|sign| &*sign.track)); | ||
} | ||
res | ||
} | ||
|
||
fn get_object_cache(&self) -> ObjectCache { | ||
ObjectCache::NeutralSection(self.clone()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#[macro_use] | ||
extern crate diesel; | ||
#[macro_use] | ||
extern crate cfg_if; | ||
|
||
mod client; | ||
mod core; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.