chore: 添加实体文件定义(非最终)

This commit is contained in:
amtoaer
2024-03-23 00:06:35 +08:00
parent 762dad5d83
commit 34c1f49d48
8 changed files with 2276 additions and 0 deletions

2173
entity/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

9
entity/Cargo.toml Normal file
View File

@@ -0,0 +1,9 @@
[package]
name = "entity"
version = "0.1.0"
edition = "2021"
[dependencies]
sea-orm = { version = "0.12" }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0"

View File

@@ -0,0 +1,22 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "favorite")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(unique)]
pub f_id: i32,
pub name: String,
pub path: String,
pub enabled: bool,
pub created_at: String,
pub updated_at: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {}

View File

@@ -0,0 +1,7 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
pub mod prelude;
pub mod favorite;
pub mod page;
pub mod video;

View File

@@ -0,0 +1,26 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "page")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub video_id: i32,
pub cid: i32,
pub page: i32,
pub name: String,
pub path: String,
pub image: String,
pub valid: bool,
pub download_status: i32,
pub downloaded: bool,
pub created_at: String,
pub updated_at: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {}

View File

@@ -0,0 +1,5 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
pub use super::favorite::Entity as Favorite;
pub use super::page::Entity as Page;
pub use super::video::Entity as Video;

View File

@@ -0,0 +1,32 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "video")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub favorite_id: i32,
pub upper_id: i32,
pub name: String,
pub path: String,
pub category: String,
pub bvid: String,
pub intro: String,
pub cover: String,
pub ctime: String,
pub pubtime: String,
pub favtime: String,
pub downloaded: bool,
pub valid: bool,
pub tags: String,
pub single_page: bool,
pub created_at: String,
pub updated_at: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {}

2
entity/src/lib.rs Normal file
View File

@@ -0,0 +1,2 @@
mod entities;
pub use entities::*;