Renamed endpoints.rs to endpoints_v1.rs
APIs will now use /v1/...
This commit is contained in:
parent
560b90be55
commit
8169dfd022
8 changed files with 66 additions and 19 deletions
|
@ -1,13 +1,13 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq)]
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone)]
|
||||
pub enum ChargingStatus {
|
||||
Charging,
|
||||
Battery,
|
||||
UNKNOWN,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
pub struct BatteryInfo {
|
||||
pub has_battery: bool,
|
||||
pub battery_percent: i8,
|
||||
|
@ -22,4 +22,7 @@ impl BatteryInfo {
|
|||
charging_status: ChargingStatus::UNKNOWN
|
||||
}
|
||||
}
|
||||
pub fn to_string(self) -> String {
|
||||
serde_json::to_string(&self).expect("Failed to parse into string")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue