mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2026-04-30 18:49:09 +00:00
added serde for serializing in the webserver
This commit is contained in:
@@ -17,6 +17,8 @@ use static_cell::make_static;
|
||||
|
||||
use crate::{store::TallyID, webserver::start_webserver};
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
mod drivers;
|
||||
mod feedback;
|
||||
mod init;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
extern crate alloc;
|
||||
|
||||
use super::TallyID;
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::string::String;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
pub struct Name {
|
||||
pub first: String,
|
||||
pub last: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
pub struct IDMapping {
|
||||
id_map: BTreeMap<TallyID, Name>,
|
||||
}
|
||||
@@ -28,4 +29,3 @@ impl IDMapping {
|
||||
self.id_map.insert(id, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
extern crate alloc;
|
||||
|
||||
use super::Date;
|
||||
use super::IDMapping;
|
||||
use super::TallyID;
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AttendanceDay {
|
||||
date: Date,
|
||||
ids: Vec<TallyID>,
|
||||
@@ -30,9 +29,10 @@ impl AttendanceDay {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct IDStore {
|
||||
days: BTreeMap<Date, AttendanceDay>,
|
||||
mapping: IDMapping,
|
||||
pub days: BTreeMap<Date, AttendanceDay>,
|
||||
pub mapping: IDMapping,
|
||||
}
|
||||
|
||||
impl IDStore {
|
||||
|
||||
Reference in New Issue
Block a user