Skip to main content

dandanapi/methods/
trending_get_rising_bangumi.rs

1use super::*;
2use crate::Request;
3use reqwest::Method;
4use serde::{Deserialize, Serialize};
5use std::borrow::Cow;
6#[doc = "### 接口说明 返回最近一个可用统计周期内,相比上一对应周期热度增长最快的番剧列表。 ### 数据口径 飙升榜会综合当前周期热度值与相对上一周期的热度增量计算得分,用于识别最近快速升温的作品。 ### 所需权限 当未提供 jwt token 时,将认为是匿名用户,返回的番剧列表中 `isFavorited` 始终为 `false`。 当提供 jwt token 时(登录状态),返回的番剧列表中将按照当前用户对番剧关注状态设定 `isFavorited` 值。 ### 数据出处说明 使用此榜单数据时,请注明数据来源为`弹弹play开放弹幕网络`。"]
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct TrendingGetRisingBangumi {
9    #[doc = "统计周期。可选值:week、month、quarter"]
10    pub period: String,
11    pub params: TrendingGetRisingBangumiParams,
12}
13#[derive(Debug, Clone, Serialize, Deserialize)]
14pub struct TrendingGetRisingBangumiParams {
15    #[doc = "是否过滤成人内容"]
16    #[serde(rename = "filterAdultContent")]
17    pub filter_adult_content: bool,
18    #[doc = "返回条目数量,默认20,最大50"]
19    #[serde(rename = "limit")]
20    pub limit: i32,
21}
22impl Request for TrendingGetRisingBangumi {
23    type Response = TrendingBangumiResponse;
24    type Body = ();
25    type Params = TrendingGetRisingBangumiParams;
26    const METHOD: Method = Method::GET;
27    const PATH: &'static str = "/api/v2/trending/all/rising/{period}";
28    fn params(&self) -> Option<&Self::Params> {
29        Some(&self.params)
30    }
31    fn path(&self) -> Cow<'static, str> {
32        let path = Self::PATH.replace("{period}", &self.period.to_string_or_empty());
33        Cow::Owned(path)
34    }
35}