Skip to main content

ncm_api_rs/api/
user_detail_new.rs

1use super::Query;
2use crate::error::Result;
3/// 用户详情(新版)
4/// 对应 Node.js module/user_detail_new.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 用户详情(新版)
10    /// 对应 /user/detail/new
11    pub async fn user_detail_new(&self, query: &Query) -> Result<ApiResponse> {
12        let uid = query.get_or("uid", "0");
13        let data = json!({
14            "all": "true",
15            "userId": uid
16        });
17        self.request(
18            &format!("/api/w/v1/user/detail/{}", uid),
19            data,
20            query.to_option(CryptoType::default()),
21        )
22        .await
23    }
24}