feat: 保存视频标签,设置 video 和 page 的关系
This commit is contained in:
@@ -19,6 +19,19 @@ pub struct Model {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
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 {}
|
||||
|
||||
@@ -22,12 +22,21 @@ pub struct Model {
|
||||
pub favtime: DateTime,
|
||||
pub handled: bool,
|
||||
pub valid: bool,
|
||||
pub tags: Option<String>,
|
||||
pub tags: Option<serde_json::Value>,
|
||||
pub single_page: Option<bool>,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
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 {}
|
||||
|
||||
Reference in New Issue
Block a user