use crate::{ BilibiliRequest, BpiClient, BpiError, BpiResponse };
use serde::{ Deserialize, Serialize };
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DailyReward {
pub login: bool,
pub watch: bool,
pub coins: u32,
pub share: bool,
pub email: bool,
pub tel: bool,
pub safe_question: bool,
pub identify_card: bool,
}
impl BpiClient {
pub async fn member_center_daily_reward(&self) -> Result<BpiResponse<DailyReward>, BpiError> {
self
.get("https://api.bilibili.com/x/member/web/exp/reward")
.header("Referer", "")
.send_bpi("查询每日奖励状态").await
}
}
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn test_get_daily_reward() -> Result<(), BpiError> {
let bpi = BpiClient::new();
let result = bpi.member_center_daily_reward().await?;
println!("{:?}", result);
Ok(())
}
}