chore: add PingResp
This commit is contained in:
@@ -5,7 +5,10 @@ use sdgb_api::{
|
||||
title::{
|
||||
MaiVersionExt, Sdgb1_40, Sdgb1_50,
|
||||
methods::APIMethod,
|
||||
model::{GetUserPreviewApi, GetUserPreviewApiResp, Ping, UserLogoutApi, UserLogoutApiResp},
|
||||
model::{
|
||||
GetUserPreviewApi, GetUserPreviewApiResp, Ping, PingResp, UserLogoutApi,
|
||||
UserLogoutApiResp,
|
||||
},
|
||||
},
|
||||
};
|
||||
use spdlog::{error, info};
|
||||
@@ -47,16 +50,17 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
|
||||
println!("{preview}");
|
||||
}
|
||||
commands::Commands::Ping => {
|
||||
let decoded = Sdgb1_40::request_raw(
|
||||
let decoded: PingResp = Sdgb1_40::request(
|
||||
&client,
|
||||
APIMethod::Ping,
|
||||
"",
|
||||
Ping {}, // note: must not be `Ping`, or serde_json serializes to nothing
|
||||
)
|
||||
.await?;
|
||||
info!("sdgb 1.40 resp: {:?}", String::from_utf8_lossy(&decoded));
|
||||
let decoded = Sdgb1_50::request_raw(&client, APIMethod::Ping, "", Ping {}).await?;
|
||||
info!("sdgb 1.50 resp: {:?}", String::from_utf8_lossy(&decoded));
|
||||
info!("sdgb 1.40 resp: {decoded}");
|
||||
let decoded: PingResp =
|
||||
Sdgb1_50::request(&client, APIMethod::Ping, "", Ping {}).await?;
|
||||
info!("sdgb 1.50 resp: {decoded}");
|
||||
}
|
||||
commands::Commands::QRLogin { ref qrcode_content } => {
|
||||
let qrcode = QRCode { qrcode_content };
|
||||
|
||||
Reference in New Issue
Block a user