1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::requests::prelude::*;
#[derive(Debug, Deserialize)]
pub struct UserInfo {
pub mid: u64,
pub name: String,
#[serde(rename = "face")]
pub avatar_url: String,
pub followers: u64,
pub following: u64,
pub sign: String,
}
impl Request for UserInfo {
type Args = u64;
fn request(client: &Client, args: Self::Args) -> RequestResponse<Self> {
const URL: &str = "https://api.bilibili.com/x/web-interface/card";
let r = client.get(URL).query(&[("mid", args)]).send();
Box::pin(async move { r.await?.bili_data().await })
}
}