bpi_rs/user/relation/
following_group.rs1use crate::{BilibiliRequest, BpiClient, BpiError, BpiResponse};
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Deserialize, Serialize)]
9pub struct FollowTag {
10 pub tagid: i64, pub name: String, pub count: i64, pub tip: Option<String>, }
15
16impl BpiClient {
17 pub async fn user_follow_tags(&self) -> Result<BpiResponse<Vec<FollowTag>>, BpiError> {
21 self.get("https://api.bilibili.com/x/relation/tags")
22 .send_bpi("查询关注分组列表")
23 .await
24 }
25}
26
27#[cfg(test)]
28mod tests {
29 use super::*;
30 use tracing::info;
31
32 #[tokio::test]
33 async fn test_user_follow_tags_cookie() {
34 let bpi = BpiClient::new();
35 let resp = bpi.user_follow_tags().await;
36 assert!(resp.is_ok());
37
38 let data = resp.unwrap().data.unwrap();
39 info!("关注分组列表: {:?}", data);
40 }
41}