From 594be9f78913b23649ee981a3913f8bccd34449c Mon Sep 17 00:00:00 2001 From: Wei Zhang Date: Tue, 10 Dec 2024 11:45:37 +0800 Subject: [PATCH] chore: drop not used dao func Signed-off-by: Wei Zhang --- ee/tabby-schema/src/dao.rs | 64 -------------------------------------- 1 file changed, 64 deletions(-) diff --git a/ee/tabby-schema/src/dao.rs b/ee/tabby-schema/src/dao.rs index ddbd3a054a71..e2cbd719bf13 100644 --- a/ee/tabby-schema/src/dao.rs +++ b/ee/tabby-schema/src/dao.rs @@ -229,39 +229,6 @@ impl From<&thread::MessageAttachmentCodeInput> for ThreadMessageAttachmentClient } } -impl From for thread::MessageAttachmentDoc { - fn from(value: ThreadMessageAttachmentDoc) -> Self { - match value { - ThreadMessageAttachmentDoc::Web(val) => { - thread::MessageAttachmentDoc::Web(thread::MessageAttachmentWebDoc { - title: val.title, - link: val.link, - content: val.content, - }) - } - ThreadMessageAttachmentDoc::Issue(val) => { - thread::MessageAttachmentDoc::Issue(thread::MessageAttachmentIssueDoc { - title: val.title, - link: val.link, - author: None, // will be filled in service layer - body: val.body, - closed: val.closed, - }) - } - ThreadMessageAttachmentDoc::Pull(val) => { - thread::MessageAttachmentDoc::Pull(thread::MessageAttachmentPullDoc { - title: val.title, - link: val.link, - author: None, // will be filled in service layer - body: val.body, - patch: val.diff, - merged: val.merged, - }) - } - } - } -} - pub fn from_thread_message_attachment_document( doc: ThreadMessageAttachmentDoc, author: Option, @@ -344,37 +311,6 @@ impl From for thread::Thread { } } -impl TryFrom for thread::Message { - type Error = anyhow::Error; - fn try_from(value: ThreadMessageDAO) -> Result { - let code = value.code_attachments; - let client_code = value.client_code_attachments; - let doc = value.doc_attachments; - - let attachment = MessageAttachment { - code: code - .map(|x| x.0.into_iter().map(|i| i.into()).collect()) - .unwrap_or_default(), - client_code: client_code - .map(|x| x.0.into_iter().map(|i| i.into()).collect()) - .unwrap_or_default(), - doc: doc - .map(|x| x.0.into_iter().map(|i| i.into()).collect()) - .unwrap_or_default(), - }; - - Ok(Self { - id: value.id.as_id(), - thread_id: value.thread_id.as_id(), - role: thread::Role::from_enum_str(&value.role)?, - content: value.content, - attachment, - created_at: value.created_at, - updated_at: value.updated_at, - }) - } -} - lazy_static! { static ref HASHER: HashIds = HashIds::builder() .with_salt("tabby-id-serializer")