chore: 添加实体文件定义(非最终)
This commit is contained in:
2173
entity/Cargo.lock
generated
Normal file
2173
entity/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
9
entity/Cargo.toml
Normal file
9
entity/Cargo.toml
Normal 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"
|
||||
22
entity/src/entities/favorite.rs
Normal file
22
entity/src/entities/favorite.rs
Normal 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 {}
|
||||
7
entity/src/entities/mod.rs
Normal file
7
entity/src/entities/mod.rs
Normal 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;
|
||||
26
entity/src/entities/page.rs
Normal file
26
entity/src/entities/page.rs
Normal 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 {}
|
||||
5
entity/src/entities/prelude.rs
Normal file
5
entity/src/entities/prelude.rs
Normal 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;
|
||||
32
entity/src/entities/video.rs
Normal file
32
entity/src/entities/video.rs
Normal 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
2
entity/src/lib.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod entities;
|
||||
pub use entities::*;
|
||||
Reference in New Issue
Block a user