Initial commit
This commit is contained in:
commit
f67dcd8f2a
31 changed files with 3297 additions and 0 deletions
44
src/schemas/novel.rs
Normal file
44
src/schemas/novel.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
use std::num::NonZeroU8;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::platform::Platform;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Download {
|
||||
pub file_name: String,
|
||||
pub platform: Platform,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct StoredNovel {
|
||||
#[serde(flatten)]
|
||||
pub novel: Novel,
|
||||
|
||||
pub modified_at: jiff::Zoned,
|
||||
pub created_at: jiff::Zoned,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FullNovel {
|
||||
pub data: Novel,
|
||||
|
||||
pub upload_queue: Vec<String>,
|
||||
pub files: Vec<String>,
|
||||
pub screenshots: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Novel {
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
|
||||
pub vndb: Option<url::Url>,
|
||||
pub hours_to_read: Option<NonZeroU8>,
|
||||
|
||||
pub tags: Vec<String>,
|
||||
pub genres: Vec<String>,
|
||||
|
||||
pub tg_post: Option<url::Url>,
|
||||
pub post_at: jiff::Zoned,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue