use crate::{ BilibiliRequest, BpiClient, BpiError, BpiResponse };
use serde::{ Deserialize, Serialize };
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct FollowTag {
pub tagid: i64, pub name: String, pub count: i64, pub tip: Option<String>, }
impl BpiClient {
pub async fn user_follow_tags(&self) -> Result<BpiResponse<Vec<FollowTag>>, BpiError> {
self.get("https://api.bilibili.com/x/relation/tags").send_bpi("查询关注分组列表").await
}
}
#[cfg(test)]
mod tests {
use super::*;
use tracing::info;
#[tokio::test]
async fn test_user_follow_tags_cookie() {
let bpi = BpiClient::new();
let resp = bpi.user_follow_tags().await;
assert!(resp.is_ok());
let data = resp.unwrap().data.unwrap();
info!("关注分组列表: {:?}", data);
}
}