parse_book_source/book/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use serde::{Deserialize, Serialize};

pub type BookList = Vec<BookListItem>;
pub type ChapterList = Vec<Chapter>;
pub type ExploreList = Vec<ExploreItem>;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExploreItem {
    pub title: String,
    pub url: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BookListItem {
    pub book_url: String,

    #[serde(flatten)]
    pub book_info: BookInfo,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BookInfo {
    pub author: String,
    pub cover_url: String,
    pub intro: String,
    pub kind: String,
    pub last_chapter: String,
    pub name: String,
    pub toc_url: String,
    pub word_count: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Chapter {
    pub chapter_name: String,
    pub chapter_url: String,
}