refactor: add Ext postfix for APIExt types

This commit is contained in:
mokurin000
2025-08-03 12:15:37 +08:00
parent 0d379bf248
commit 9a6e414793
2 changed files with 12 additions and 7 deletions

View File

@@ -203,7 +203,7 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
#[cfg(feature = "fetchall")]
Commands::ListAllUser { concurrency } => {
use crate::{cache::PLAYERS, utils::helpers::cached_concurrent_fetch};
use sdgb_api::title::methods::GetUserPreviewApi;
use sdgb_api::title::methods::GetUserPreviewApiExt;
use std::io::BufRead as _;
let mut user_ids = Vec::new();
@@ -222,8 +222,13 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
}
}
cached_concurrent_fetch::<GetUserPreviewApi>(user_ids, &client, concurrency, PLAYERS)
.await?;
cached_concurrent_fetch::<GetUserPreviewApiExt>(
user_ids,
&client,
concurrency,
PLAYERS,
)
.await?;
}
#[cfg(feature = "fetchall")]
@@ -232,7 +237,7 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
min_rating,
max_rating,
} => {
use sdgb_api::title::methods;
use sdgb_api::title::methods::GetUserRatingApiExt;
use crate::{
cache::{PLAYER_B50, PLAYERS},
@@ -242,7 +247,7 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
let mut players: Vec<GetUserPreviewApiResp> = read_cache(PLAYERS)?;
players.retain(|p| p.player_rating >= min_rating && p.player_rating <= max_rating);
cached_concurrent_fetch::<methods::GetUserRatingApi>(
cached_concurrent_fetch::<GetUserRatingApiExt>(
players.iter().map(|p| p.user_id).collect::<Vec<u32>>(),
&client,
concurrency,