diff options
author | FxQnLr <[email protected]> | 2024-04-10 13:29:01 +0200 |
---|---|---|
committer | FxQnLr <[email protected]> | 2024-04-10 13:29:01 +0200 |
commit | 07740f3d985b4cc921b69cd45ec9191a2daecd67 (patch) | |
tree | 24ae945e7eb003a30d55552dcb8cdb59b227469f /src/routes/start.rs | |
parent | bd5ed2f47fe870776783a5b2a56c899126a51860 (diff) | |
download | webol-07740f3d985b4cc921b69cd45ec9191a2daecd67.tar webol-07740f3d985b4cc921b69cd45ec9191a2daecd67.tar.gz webol-07740f3d985b4cc921b69cd45ec9191a2daecd67.zip |
Closes #31. Renamed Payloads
Diffstat (limited to 'src/routes/start.rs')
-rw-r--r-- | src/routes/start.rs | 8 |
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; | |||
26 | pub async fn post( | 26 | pub 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( | |||
52 | fn send_wol( | 52 | fn 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)] |
137 | pub struct Payload { | 137 | pub struct SPayload { |
138 | ping: Option<bool>, | 138 | ping: Option<bool>, |
139 | } | 139 | } |
140 | 140 | ||