refactor: implement fetchall with generic type
This commit is contained in:
21
sdgb-api/src/title/methods/has_uid/mod.rs
Normal file
21
sdgb-api/src/title/methods/has_uid/mod.rs
Normal 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"
|
||||
]);
|
||||
Reference in New Issue
Block a user