chore: use camelCase for json
This commit is contained in:
parent
b1a98a36b7
commit
c6aebd8dae
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Room {
|
||||
pub room_number: i32,
|
||||
pub floor: i32,
|
||||
|
@ -11,6 +12,7 @@ pub struct Room {
|
|||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Address {
|
||||
pub street: String,
|
||||
pub house_number: i32,
|
||||
|
@ -20,6 +22,7 @@ pub struct Address {
|
|||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Person {
|
||||
pub id: i32,
|
||||
pub first_name: String,
|
||||
|
@ -29,6 +32,7 @@ pub struct Person {
|
|||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Clerk {
|
||||
pub staff_number: i32,
|
||||
pub salary: i32,
|
||||
|
@ -36,6 +40,7 @@ pub struct Clerk {
|
|||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Client {
|
||||
pub id: i32,
|
||||
pub bank_details: String,
|
||||
|
@ -43,6 +48,7 @@ pub struct Client {
|
|||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Booking {
|
||||
pub id: i32,
|
||||
pub arrival_date: String,
|
||||
|
@ -66,6 +72,7 @@ pub struct BookingQuery {
|
|||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BookingBody {
|
||||
pub arrival_date: String,
|
||||
pub depature_date: String,
|
||||
|
|
Loading…
Reference in a new issue