Skip to content

Commit

Permalink
Fix up CI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Meade committed Jul 24, 2024
1 parent 739836f commit a84560b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
25 changes: 12 additions & 13 deletions src/routes/v1/disks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use gotham::{router::response::StaticResponseExtender, state::StateData};
use gotham_restful::{endpoint, gotham::hyper::Method, read, search, Resource, Success};
use log::{error, info};
use log::info;
use serde::{Deserialize, Serialize};

use crate::routes::v1::{EventResource, EventResources};
Expand All @@ -25,15 +25,13 @@ pub struct DiskResources {

#[derive(Clone, Deserialize, StateData, StaticResponseExtender)]
struct DiskSearchQuery {
serial_number: String,
_serial_number: String,
}

#[search]
fn find_disk_by_query(query: DiskSearchQuery) -> Success<DiskResources> {
fn find_disk_by_query(_query: DiskSearchQuery) -> Success<DiskResources> {
info!("find_disk_by_query()");
DiskResources {
disks: Vec::new()
}.into()
DiskResources { disks: Vec::new() }.into()
}

// --------------------------------------------------------------------------------------------------------------------
Expand All @@ -48,7 +46,7 @@ fn get_disk_by_id(disk_id: u64) -> Success<DiskResource> {

#[derive(Clone, Deserialize, StateData, StaticResponseExtender)]
struct DiskAndEvent {
disk_id: u64,
_disk_id: u64,
event_id: u64,
}

Expand All @@ -60,14 +58,17 @@ struct DiskAndEvent {
)]
fn get_event_by_disk_id_and_event_id(disk_and_event: DiskAndEvent) -> Success<EventResource> {
info!("get_event_by_disk_id_and_event_id()");
EventResource { id: disk_and_event.event_id }.into()
EventResource {
id: disk_and_event.event_id,
}
.into()
}

// --------------------------------------------------------------------------------------------------------------------

#[derive(Clone, Deserialize, StateData, StaticResponseExtender)]
struct Disk {
disk_id: u64,
_disk_id: u64,
}

#[endpoint(
Expand All @@ -76,9 +77,7 @@ struct Disk {
params = false,
body = false
)]
fn get_events_by_disk_id(disk: Disk) -> Success<EventResources> {
fn get_events_by_disk_id(_disk: Disk) -> Success<EventResources> {
info!("get_events_by_disk_id()");
EventResources {
events: Vec::new()
}.into()
EventResources { events: Vec::new() }.into()
}
15 changes: 6 additions & 9 deletions src/routes/v1/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

use gotham::{router::response::StaticResponseExtender, state::StateData};
use gotham_restful::{create, read, search, Resource, Success};
use log::{error, info};
use log::info;
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};

#[derive(Resource, Serialize)]
#[resource(create_event)]
Expand All @@ -23,11 +22,11 @@ pub struct EventResources {

#[derive(Clone, Deserialize, StateData, StaticResponseExtender)]
struct EventBody {
serial_number: String,
_serial_number: String,
}

#[create]
fn create_event(body: EventBody) -> Success<EventResource> {
fn create_event(_body: EventBody) -> Success<EventResource> {
info!("create_event()");
EventResource { id: 0 }.into()
}
Expand All @@ -36,15 +35,13 @@ fn create_event(body: EventBody) -> Success<EventResource> {

#[derive(Clone, Deserialize, StateData, StaticResponseExtender)]
struct EventSearchQuery {
serial_number: String,
_serial_number: String,
}

#[search]
fn find_event_by_query(query: EventSearchQuery) -> Success<EventResources> {
fn find_event_by_query(_query: EventSearchQuery) -> Success<EventResources> {
info!("find_event_by_query()");
EventResources {
events: Vec::new(),
}.into()
EventResources { events: Vec::new() }.into()
}

// --------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit a84560b

Please sign in to comment.