bangumi_api/module/indice/
model.rs1use serde::{Deserialize, Serialize};
2
3use crate::module::{
4 model::{Image, InfoBox, Stat},
5 revision::model::Creator,
6 subject::model::SubjectType,
7};
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
13pub struct Index {
14 pub id: u32,
16 pub title: String,
18 pub desc: String,
20 pub total: Option<u32>,
22 pub stat: Stat,
24 pub created_at: String,
26 pub updated_at: String,
28 pub creator: Creator,
30 pub ban: bool,
32 pub nsfw: bool,
34}
35
36#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct IndexBasicInfo {
41 pub title: Option<String>,
43 pub description: Option<String>,
45}
46
47#[derive(Debug, Clone, Serialize, Deserialize)]
51pub struct IndexSubjectAddInfo {
52 pub subject_id: Option<u32>,
54 pub sort: Option<u32>,
56 pub comment: Option<String>,
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
64pub struct IndexSubjectEditInfo {
65 pub sort: Option<u32>,
67 pub comment: Option<String>,
69}
70
71#[derive(Debug, Clone, Serialize, Deserialize)]
75pub struct IndexSubject {
76 pub id: u32,
78 pub r#type: SubjectType,
80 pub name: String,
82 pub name_cn: String,
84 pub date: Option<String>,
86 pub images: Image,
88 pub infobox: InfoBox,
90 pub add_at: Option<String>,
92 pub comment: String,
94}