Skip to main content

ncm_api_rs/api/
style_artist.rs

1use super::Query;
2use crate::error::Result;
3/// 曲风-歌手
4/// 对应 Node.js module/style_artist.js
5use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9    /// 曲风-歌手
10    /// 对应 /style/artist
11    pub async fn style_artist(&self, query: &Query) -> Result<ApiResponse> {
12        let data = json!({
13            "cursor": query.get_or("cursor", "0").parse::<i64>().unwrap_or(0),
14            "size": query.get_or("size", "20").parse::<i64>().unwrap_or(20),
15            "tagId": query.get_or("tagId", ""),
16            "sort": 0
17        });
18        self.request(
19            "/api/style-tag/home/artist",
20            data,
21            query.to_option(CryptoType::Weapi),
22        )
23        .await
24    }
25}