chore: 修改项目路径结构,使用 workspace 组织包 (#118)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2024-06-07 10:56:53 -07:00
committed by GitHub
parent c4db12b154
commit 1744f8647b
44 changed files with 181 additions and 4753 deletions

View 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 {}

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,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 {}

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,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 {}

View File

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