impl tags api (#2)

This commit is contained in:
Kould
2023-12-13 16:44:52 +08:00
committed by GitHub
parent c6d0d85ab5
commit f102c608bb
22 changed files with 319 additions and 79 deletions

View File

@ -6,15 +6,13 @@ use serde::{Deserialize, Serialize};
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub dialog_id: i64,
#[sea_orm(primary_key, auto_increment = false)]
#[sea_orm(index)]
pub uid: i64,
pub dialog_name: String,
pub history: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
#[sea_orm(soft_delete_column)]
pub is_deleted: bool,
pub created_at: Date,
pub updated_at: Date,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
@ -22,11 +20,11 @@ pub enum Relation {}
impl Related<super::kb_info::Entity> for Entity {
fn to() -> RelationDef {
super::dialog_2_kb::Relation::KbInfo.def()
super::dialog2_kb::Relation::KbInfo.def()
}
fn via() -> Option<RelationDef> {
Some(super::dialog_2_kb::Relation::DialogInfo.def().rev())
Some(super::dialog2_kb::Relation::DialogInfo.def().rev())
}
}