消息渠道支持会话相关指令
This commit is contained in:
35
src-tauri/src/db/entities/chat_channel_sender_context.rs
Normal file
35
src-tauri/src/db/entities/chat_channel_sender_context.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
|
||||
#[sea_orm(table_name = "chat_channel_sender_context")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
pub channel_id: i32,
|
||||
pub sender_id: String,
|
||||
pub current_folder_id: Option<i32>,
|
||||
pub current_agent_type: Option<String>,
|
||||
pub current_conversation_id: Option<i32>,
|
||||
pub current_connection_id: Option<String>,
|
||||
pub auto_approve: bool,
|
||||
pub created_at: DateTimeUtc,
|
||||
pub updated_at: DateTimeUtc,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::chat_channel::Entity",
|
||||
from = "Column::ChannelId",
|
||||
to = "super::chat_channel::Column::Id"
|
||||
)]
|
||||
ChatChannel,
|
||||
}
|
||||
|
||||
impl Related<super::chat_channel::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::ChatChannel.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
Reference in New Issue
Block a user