parse_book_source/
model.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
7pub struct Chapter {
8 pub title: String,
9 pub url: String,
10 #[serde(default)]
11 pub is_volume: bool,
12}
13
14#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
16pub struct Volume {
17 pub title: String,
18 pub first_chapter_index: usize,
19}
20
21#[derive(Debug, Clone, Default, PartialEq, Eq)]
23pub struct Toc {
24 pub chapters: Vec<Chapter>,
25 pub volumes: Vec<Volume>,
26}
27
28#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
30pub struct BookInfo {
31 pub name: String,
32 pub author: String,
33 pub cover: String,
34 pub intro: String,
35 pub kind: String,
36 pub last_chapter: String,
37 pub toc_url: String,
38 pub word_count: String,
39}
40
41#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
43pub struct BookListItem {
44 #[serde(flatten)]
45 pub info: BookInfo,
46 pub book_url: String,
47}