feat: a bunch of things

This commit is contained in:
Andrea Toska 2025-02-27 10:25:31 +01:00
commit 2e2b01990e
20 changed files with 16216 additions and 137 deletions

28
src/nnid/devices.rs Normal file
View file

@ -0,0 +1,28 @@
use rocket::get;
use serde::Serialize;
use crate::xml::Xml;
#[derive(Serialize)]
#[serde(rename(serialize = "device"))]
pub struct Device;
#[get("/v1/api/devices/@current/status")]
pub fn current_device_status() -> Xml<Device>{
Xml(Device)
}
#[cfg(test)]
mod tests {
use std::str::from_utf8;
use crate::nnid::devices::Device;
#[test]
fn test_device_data(){
let text = crate::xml::serialize_with_version(&Device).unwrap();
println!("{}", text);
}
}