Add REST endpoint for slot

This commit is contained in:
Simon Goller 2024-05-02 23:25:04 +02:00
parent 82e89baeeb
commit 8f378472ea
28 changed files with 1925 additions and 28 deletions

16
service_impl/src/clock.rs Normal file
View file

@ -0,0 +1,16 @@
use service::clock::ClockService;
use time::OffsetDateTime;
pub struct ClockServiceImpl;
impl ClockService for ClockServiceImpl {
fn time_now(&self) -> time::Time {
OffsetDateTime::now_utc().time()
}
fn date_now(&self) -> time::Date {
OffsetDateTime::now_utc().date()
}
fn date_time_now(&self) -> time::PrimitiveDateTime {
let now = OffsetDateTime::now_utc();
time::PrimitiveDateTime::new(now.date(), now.time())
}
}