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/device.rs | |
parent | bd5ed2f47fe870776783a5b2a56c899126a51860 (diff) | |
download | webol-07740f3d985b4cc921b69cd45ec9191a2daecd67.tar webol-07740f3d985b4cc921b69cd45ec9191a2daecd67.tar.gz webol-07740f3d985b4cc921b69cd45ec9191a2daecd67.zip |
Closes #31. Renamed Payloads
Diffstat (limited to 'src/routes/device.rs')
-rw-r--r-- | src/routes/device.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/routes/device.rs b/src/routes/device.rs index b6bd9d0..49361f2 100644 --- a/src/routes/device.rs +++ b/src/routes/device.rs | |||
@@ -32,7 +32,7 @@ pub async fn get(Path(id): Path<String>) -> Result<Json<Value>, Error> { | |||
32 | } | 32 | } |
33 | 33 | ||
34 | #[derive(Deserialize, ToSchema)] | 34 | #[derive(Deserialize, ToSchema)] |
35 | pub struct Payload { | 35 | pub struct DPayload { |
36 | id: String, | 36 | id: String, |
37 | mac: String, | 37 | mac: String, |
38 | broadcast_addr: String, | 38 | broadcast_addr: String, |
@@ -42,14 +42,14 @@ pub struct Payload { | |||
42 | #[utoipa::path( | 42 | #[utoipa::path( |
43 | put, | 43 | put, |
44 | path = "/device", | 44 | path = "/device", |
45 | request_body = Payload, | 45 | request_body = DPayload, |
46 | responses( | 46 | responses( |
47 | (status = 200, description = "add device to storage", body = [DeviceSchema]) | 47 | (status = 200, description = "add device to storage", body = [DeviceSchema]) |
48 | ), | 48 | ), |
49 | security((), ("api_key" = [])) | 49 | security((), ("api_key" = [])) |
50 | )] | 50 | )] |
51 | pub async fn put( | 51 | pub async fn put( |
52 | Json(payload): Json<Payload>, | 52 | Json(payload): Json<DPayload>, |
53 | ) -> Result<Json<Value>, Error> { | 53 | ) -> Result<Json<Value>, Error> { |
54 | info!( | 54 | info!( |
55 | "add device {} ({}, {}, {})", | 55 | "add device {} ({}, {}, {})", |
@@ -73,14 +73,14 @@ pub async fn put( | |||
73 | #[utoipa::path( | 73 | #[utoipa::path( |
74 | post, | 74 | post, |
75 | path = "/device", | 75 | path = "/device", |
76 | request_body = Payload, | 76 | request_body = DPayload, |
77 | responses( | 77 | responses( |
78 | (status = 200, description = "update device in storage", body = [DeviceSchema]) | 78 | (status = 200, description = "update device in storage", body = [DeviceSchema]) |
79 | ), | 79 | ), |
80 | security((), ("api_key" = [])) | 80 | security((), ("api_key" = [])) |
81 | )] | 81 | )] |
82 | pub async fn post( | 82 | pub async fn post( |
83 | Json(payload): Json<Payload>, | 83 | Json(payload): Json<DPayload>, |
84 | ) -> Result<Json<Value>, Error> { | 84 | ) -> Result<Json<Value>, Error> { |
85 | info!( | 85 | info!( |
86 | "edit device {} ({}, {}, {})", | 86 | "edit device {} ({}, {}, {})", |