fix: update serialization for new state string type

This commit is contained in:
Jef Roosens 2024-02-15 14:00:09 +01:00
parent 83e9d3e8cf
commit 7fd6d55e71
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
6 changed files with 47 additions and 16 deletions

View file

@ -10,3 +10,5 @@ affluences-api = { path = "../affluences-api" }
clap = { version = "4.2.7", features = ["derive"] }
serde_json = "1.0.96"
tokio = { version = "1.28.1", features = ["full"] }
uuid = "*"
chrono = "*"

View file

@ -1,5 +1,9 @@
use affluences_api::AffluencesClient;
use chrono::NaiveDate;
use clap::{Parser, Subcommand};
use uuid::{uuid, Uuid};
const STERRE_BIB_ID: Uuid = uuid!("4737e57a-ee05-4f7b-901a-7bb541eeb297");
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
@ -11,7 +15,10 @@ struct Cli {
#[derive(Subcommand)]
enum Commands {
/// does testing things
SearchSite { query: String },
SearchSite {
query: String,
},
Available,
}
#[tokio::main]
@ -25,6 +32,14 @@ async fn main() {
let s = serde_json::to_string_pretty(&res).unwrap();
println!("{}", s);
}
Some(Commands::Available) => {
let res = client
.available(STERRE_BIB_ID, chrono::Utc::now().naive_utc().date(), 1)
.await
.unwrap();
let s = serde_json::to_string_pretty(&res).unwrap();
println!("{}", s);
}
None => {}
}
}