summaryrefslogtreecommitdiff
path: root/src/routes/start.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/start.rs')
-rw-r--r--src/routes/start.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/routes/start.rs b/src/routes/start.rs
index 6907193..ae2b384 100644
--- a/src/routes/start.rs
+++ b/src/routes/start.rs
@@ -14,7 +14,7 @@ use uuid::Uuid;
14#[utoipa::path( 14#[utoipa::path(
15 post, 15 post,
16 path = "/start/{id}", 16 path = "/start/{id}",
17 request_body = Option<Payload>, 17 request_body = Option<SPayload>,
18 responses( 18 responses(
19 (status = 200, description = "start the device with the given id", body = [Response]) 19 (status = 200, description = "start the device with the given id", body = [Response])
20 ), 20 ),
@@ -26,7 +26,7 @@ use uuid::Uuid;
26pub async fn post( 26pub async fn post(
27 State(state): State<Arc<crate::AppState>>, 27 State(state): State<Arc<crate::AppState>>,
28 Path(id): Path<String>, 28 Path(id): Path<String>,
29 payload: Option<Json<Payload>>, 29 payload: Option<Json<SPayload>>,
30) -> Result<Json<Value>, Error> { 30) -> Result<Json<Value>, Error> {
31 send_wol(state, &id, payload) 31 send_wol(state, &id, payload)
32} 32}
@@ -52,7 +52,7 @@ pub async fn get(
52fn send_wol( 52fn send_wol(
53 state: Arc<crate::AppState>, 53 state: Arc<crate::AppState>,
54 id: &str, 54 id: &str,
55 payload: Option<Json<Payload>>, 55 payload: Option<Json<SPayload>>,
56) -> Result<Json<Value>, Error> { 56) -> Result<Json<Value>, Error> {
57 info!("start request for {id}"); 57 info!("start request for {id}");
58 let device = Device::read(id)?; 58 let device = Device::read(id)?;
@@ -134,7 +134,7 @@ fn get_eta(times: Option<Vec<i64>>) -> i64 {
134} 134}
135 135
136#[derive(Deserialize, ToSchema)] 136#[derive(Deserialize, ToSchema)]
137pub struct Payload { 137pub struct SPayload {
138 ping: Option<bool>, 138 ping: Option<bool>,
139} 139}
140 140