File size: 1,543 Bytes
c6d0d85 b772fd3 c6d0d85 f102c60 c6d0d85 249b27c c6d0d85 249b27c b772fd3 c6d0d85 95c6cbb f102c60 95c6cbb f102c60 c6d0d85 f102c60 c6d0d85 f102c60 c6d0d85 f102c60 c6d0d85 f102c60 c6d0d85 f102c60 c6d0d85 f102c60 c6d0d85 249b27c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use crate::entity::kb_info;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Deserialize, Serialize)]
#[sea_orm(table_name = "doc_info")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub did: i64,
#[sea_orm(index)]
pub uid: i64,
pub doc_name: String,
pub size: i64,
#[sea_orm(column_name = "type")]
pub r#type: String,
pub kb_progress: f32,
pub kb_progress_msg: String,
pub location: String,
#[sea_orm(ignore)]
pub kb_infos: Vec<kb_info::Model>,
#[serde(skip_deserializing)]
pub created_at: Date,
#[serde(skip_deserializing)]
pub updated_at: Date,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl Related<super::tag_info::Entity> for Entity {
fn to() -> RelationDef {
super::tag2_doc::Relation::Tag.def()
}
fn via() -> Option<RelationDef> {
Some(super::tag2_doc::Relation::DocInfo.def().rev())
}
}
impl Related<super::kb_info::Entity> for Entity {
fn to() -> RelationDef {
super::kb2_doc::Relation::KbInfo.def()
}
fn via() -> Option<RelationDef> {
Some(super::kb2_doc::Relation::DocInfo.def().rev())
}
}
impl Related<Entity> for Entity {
fn to() -> RelationDef {
super::doc2_doc::Relation::Parent.def()
}
fn via() -> Option<RelationDef> {
Some(super::doc2_doc::Relation::Child.def().rev())
}
}
impl ActiveModelBehavior for ActiveModel {}
|