Skip to main content

ncm_api_rs/api/
msg_private_history.rs

1use super::Query;
2use crate::error::Result;
3/// 私信历史
4/// 对应 Node.js module/msg_private_history.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 私信历史
10    /// 对应 /msg/private/history
11    pub async fn msg_private_history(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "userId": query.get_or("uid", "0"),
14            "limit": query.get_or("limit", "30").parse::<i64>().unwrap_or(30),
15            "time": query.get_or("before", "0").parse::<i64>().unwrap_or(0),
16            "total": "true"
17        });
18        self.request(
19            "/api/msg/private/history",
20            data,
21            query.to_option(CryptoType::Weapi),
22        )
23        .await
24    }
25}