refactor: implement fetchall with generic type

This commit is contained in:
mokurin000
2025-08-02 19:39:39 +08:00
parent de330005b3
commit 9b53cb633c
9 changed files with 233 additions and 146 deletions

View File

@@ -0,0 +1,21 @@
use crate::title::methods::HasUid;
#[crabtime::function]
fn uid_get_impl(api_names: Vec<String>) {
for api_name in api_names {
crabtime::output!(
impl HasUid for crate::title::model::{{api_name}}Resp {
fn get_uid(&self) -> u32 {
self.user_id
}
}
);
}
}
uid_get_impl!([
"GetUserDataApi",
"GetUserMusicApi",
"GetUserPreviewApi",
"GetUserRatingApi"
]);