feat: a bunch of things
This commit is contained in:
parent
2cd0311a20
commit
2e2b01990e
20 changed files with 16216 additions and 137 deletions
28
src/nnid/devices.rs
Normal file
28
src/nnid/devices.rs
Normal 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);
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue