ncm_api_rs/api/
summary_annual.rs1use super::Query;
2use crate::error::Result;
3use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9 pub async fn summary_annual(&self, query: &Query) -> Result<ApiResponse> {
12 let data = json!({});
13 let year = query.get_or("year", "2023");
14 let key = match year.as_str() {
15 "2017" | "2018" | "2019" => "userdata",
16 _ => "data",
17 };
18 let url = format!("/api/activity/summary/annual/{}/{}", year, key);
19 self.request(&url, data, query.to_option(CryptoType::default()))
20 .await
21 }
22}