Skip to main content

ncm_api_rs/api/
user_comment_history.rs

1use super::Query;
2use crate::error::Result;
3/// 用户评论历史
4/// 对应 Node.js module/user_comment_history.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 用户评论历史
10    /// 对应 /user/comment/history
11    pub async fn user_comment_history(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "compose_reminder": "true",
14            "compose_hot_comment": "true",
15            "limit": query.get_or("limit", "10"),
16            "user_id": query.get("uid").unwrap_or(""),
17            "time": query.get_or("time", "0")
18        });
19        self.request(
20            "/api/comment/user/comment/history",
21            data,
22            query.to_option(CryptoType::Weapi),
23        )
24        .await
25    }
26}