chore: 修改项目路径结构,使用 workspace 组织包 (#118)
This commit is contained in:
20
crates/bili_sync_entity/src/entities/favorite.rs
Normal file
20
crates/bili_sync_entity/src/entities/favorite.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
//! `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: i64,
|
||||
pub name: String,
|
||||
pub path: String,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
7
crates/bili_sync_entity/src/entities/mod.rs
Normal file
7
crates/bili_sync_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;
|
||||
39
crates/bili_sync_entity/src/entities/page.rs
Normal file
39
crates/bili_sync_entity/src/entities/page.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Default)]
|
||||
#[sea_orm(table_name = "page")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
pub video_id: i32,
|
||||
pub cid: i64,
|
||||
pub pid: i32,
|
||||
pub name: String,
|
||||
pub width: Option<u32>,
|
||||
pub height: Option<u32>,
|
||||
pub duration: u32,
|
||||
pub path: Option<String>,
|
||||
pub image: Option<String>,
|
||||
pub download_status: u32,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::video::Entity",
|
||||
from = "Column::VideoId",
|
||||
to = "super::video::Column::Id"
|
||||
)]
|
||||
Video,
|
||||
}
|
||||
|
||||
impl Related<super::video::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Video.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
5
crates/bili_sync_entity/src/entities/prelude.rs
Normal file
5
crates/bili_sync_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;
|
||||
42
crates/bili_sync_entity/src/entities/video.rs
Normal file
42
crates/bili_sync_entity/src/entities/video.rs
Normal file
@@ -0,0 +1,42 @@
|
||||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Default)]
|
||||
#[sea_orm(table_name = "video")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
pub favorite_id: i32,
|
||||
pub upper_id: i64,
|
||||
pub upper_name: String,
|
||||
pub upper_face: String,
|
||||
pub name: String,
|
||||
pub path: String,
|
||||
pub category: i32,
|
||||
pub bvid: String,
|
||||
pub intro: String,
|
||||
pub cover: String,
|
||||
pub ctime: DateTime,
|
||||
pub pubtime: DateTime,
|
||||
pub favtime: DateTime,
|
||||
pub download_status: u32,
|
||||
pub valid: bool,
|
||||
pub tags: Option<serde_json::Value>,
|
||||
pub single_page: Option<bool>,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::page::Entity")]
|
||||
Page,
|
||||
}
|
||||
|
||||
impl Related<super::page::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Page.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
2
crates/bili_sync_entity/src/lib.rs
Normal file
2
crates/bili_sync_entity/src/lib.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod entities;
|
||||
pub use entities::*;
|
||||
Reference in New Issue
Block a user