ncm_api_rs/api/
top_playlist.rs1use super::Query;
2use crate::error::Result;
3use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9 pub async fn top_playlist(&self, query: &Query) -> Result<ApiResponse> {
12 let data = json!({
13 "cat": query.get_or("cat", "全部"),
14 "order": query.get_or("order", "hot"),
15 "limit": query.get_or("limit", "50").parse::<i64>().unwrap_or(50),
16 "offset": query.get_or("offset", "0").parse::<i64>().unwrap_or(0),
17 "total": true
18 });
19 self.request(
20 "/api/playlist/list",
21 data,
22 query.to_option(CryptoType::Weapi),
23 )
24 .await
25 }
26}