Skip to main content

ncm_api_rs/api/
user_followeds.rs

1use super::Query;
2use crate::error::Result;
3/// 用户粉丝列表
4/// 对应 Node.js module/user_followeds.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 用户粉丝列表
10    /// 对应 /user/followeds
11    pub async fn user_followeds(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "userId": query.get_or("uid", "0"),
14            "time": "0",
15            "limit": query.get_or("limit", "30").parse::<i64>().unwrap_or(30),
16            "offset": query.get_or("offset", "0").parse::<i64>().unwrap_or(0),
17            "getcounts": "true"
18        });
19        self.request(
20            &format!("/api/user/getfolloweds/{}", query.get_or("uid", "0")),
21            data,
22            query.to_option(CryptoType::default()),
23        )
24        .await
25    }
26}