mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-18 21:57:27 +08:00
format code (#14)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde::{ Deserialize, Serialize };
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Deserialize, Serialize)]
|
||||
#[sea_orm(table_name = "doc2_doc")]
|
||||
@@ -15,22 +15,24 @@ pub struct Model {
|
||||
#[derive(Debug, Clone, Copy, EnumIter)]
|
||||
pub enum Relation {
|
||||
Parent,
|
||||
Child
|
||||
Child,
|
||||
}
|
||||
|
||||
impl RelationTrait for Relation {
|
||||
fn def(&self) -> RelationDef {
|
||||
match self {
|
||||
Self::Parent => Entity::belongs_to(super::doc_info::Entity)
|
||||
.from(Column::ParentId)
|
||||
.to(super::doc_info::Column::Did)
|
||||
.into(),
|
||||
Self::Child => Entity::belongs_to(super::doc_info::Entity)
|
||||
.from(Column::Did)
|
||||
.to(super::doc_info::Column::Did)
|
||||
.into(),
|
||||
Self::Parent =>
|
||||
Entity::belongs_to(super::doc_info::Entity)
|
||||
.from(Column::ParentId)
|
||||
.to(super::doc_info::Column::Did)
|
||||
.into(),
|
||||
Self::Child =>
|
||||
Entity::belongs_to(super::doc_info::Entity)
|
||||
.from(Column::Did)
|
||||
.to(super::doc_info::Column::Did)
|
||||
.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
|
||||
Reference in New Issue
Block a user