Skip to main content

ncm_api_rs/api/
cellphone_existence_check.rs

1use super::Query;
2use crate::error::Result;
3/// 检测手机号码是否已注册
4/// 对应 Node.js module/cellphone_existence_check.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 检测手机号码是否已注册
10    /// 对应 /cellphone/existence/check
11    pub async fn cellphone_existence_check(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "cellphone": query.get("phone").unwrap_or(""),
14            "countrycode": query.get("countrycode").unwrap_or("")
15        });
16        self.request(
17            "/api/cellphone/existence/check",
18            data,
19            query.to_option(CryptoType::default()),
20        )
21        .await
22    }
23}