From b8d4044b7e6608daf1a9e5bb5960baf5b9fbd07b Mon Sep 17 00:00:00 2001 From: Havoc412 <2993167370@qq.com> Date: Wed, 20 Nov 2024 19:50:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor(model=5Fres):=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=92=8C?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了 DocInterface 接口的未实现方法 GetType - 删除了 DocResult 和 EncounterResult 类型的 ToString 方法 - 添加了 TODO 注释,标记 base_model.go 文件可能不再需要 --- app/model_res/base_model.go | 1 + app/model_res/doc.go | 13 ------------- app/model_res/encounter.go | 5 ----- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/app/model_res/base_model.go b/app/model_res/base_model.go index 69bdf3b..8490be7 100644 --- a/app/model_res/base_model.go +++ b/app/model_res/base_model.go @@ -1,5 +1,6 @@ package model_res +// TODO DELETE 这个文件或许没什么意义了。 type DocInterface interface { ToString() string } diff --git a/app/model_res/doc.go b/app/model_res/doc.go index 8a44a1d..fe120ad 100644 --- a/app/model_res/doc.go +++ b/app/model_res/doc.go @@ -24,16 +24,3 @@ type DocResult struct { Content string `json:"content" explain:"文档内容"` UpdatedAt *time.Time `json:"updated_at" explain:"最后更新时间"` } - -// GetType implements DocInterface. -func (d DocResult) GetType() string { - panic("unimplemented") -} - -/** - * @description: 实现 DocInterface 接口,输出作为 LLM 的参考内容。 - * @return {*} - */ -func (d DocResult) ToString() string { - return d.Content -} diff --git a/app/model_res/encounter.go b/app/model_res/encounter.go index 73cca1d..eec5357 100644 --- a/app/model_res/encounter.go +++ b/app/model_res/encounter.go @@ -3,7 +3,6 @@ package model_res import ( "catface/app/model" "catface/app/model_es" - "fmt" "time" ) @@ -23,7 +22,3 @@ type EncounterResult struct { Content string `json:"content" explain:"内容"` UpdatedAt *time.Time `json:"updated_at" explain:"最后更新时间"` } - -func (e EncounterResult) ToString() string { - return fmt.Sprintf(`路遇笔记标题:%s;路遇笔记内容:%s;最后更新时间:%v`, e.Title, e.Content, e.UpdatedAt) -}