From 945f3ff4fc6d1b18c6a01e2d17706c366b5ec44c Mon Sep 17 00:00:00 2001 From: wolter <11@gmail> Date: Tue, 9 Dec 2025 14:25:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BC=9A=E8=AF=9D=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/chat_history.go | 10 +++++++++- internal/entitys/chat_history.go | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/biz/chat_history.go b/internal/biz/chat_history.go index 58266e8..c3912a4 100644 --- a/internal/biz/chat_history.go +++ b/internal/biz/chat_history.go @@ -26,10 +26,18 @@ func NewChatHistoryBiz(chatHiRepo *impl.ChatHisImpl, taskRepo *impl.TaskImpl) *C // 查询会话历史 func (s *ChatHistoryBiz) List(ctx context.Context, query *entitys.ChatHistQuery) ([]entitys.ChatHisQueryResponse, error) { - chats, err := s.chatHiRepo.FindAll( + + con := []impl.CondFunc{ s.chatHiRepo.WithSessionId(query.SessionID), s.chatHiRepo.PaginateScope(query.Page, query.PageSize), s.chatHiRepo.OrderByDesc("his_id"), + } + if query.HisID > 0 { + con = append(con, s.chatHiRepo.WithHisId(query.HisID)) + } + + chats, err := s.chatHiRepo.FindAll( + con..., ) if err != nil { return nil, err diff --git a/internal/entitys/chat_history.go b/internal/entitys/chat_history.go index 019a8c6..b50148e 100644 --- a/internal/entitys/chat_history.go +++ b/internal/entitys/chat_history.go @@ -19,6 +19,7 @@ type ChatHisLog struct { } type ChatHistQuery struct { + HisID int64 `json:"his_id"` SessionID string `json:"session_id"` Page int `json:"page"` PageSize int `json:"page_size"`