Skip to main content

ncm_api_rs/api/
ugc_artist_search.rs

1use super::Query;
2use crate::error::Result;
3/// 搜索歌手
4/// 对应 Node.js module/ugc_artist_search.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 搜索歌手
10    /// 对应 /ugc/artist/search
11    pub async fn ugc_artist_search(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "keyword": query.get_or("keyword", ""),
14            "limit": query.get_or("limit", "40")
15        });
16        self.request(
17            "/api/rep/ugc/artist/search",
18            data,
19            query.to_option(CryptoType::Eapi),
20        )
21        .await
22    }
23}