From 056b3144c5ae7dd79e34e1450344ce5bbae3bab8 Mon Sep 17 00:00:00 2001 From: zpc Date: Wed, 17 Jul 2024 15:59:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs b/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs index 28cbd4b..eb10dff 100644 --- a/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs +++ b/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs @@ -196,10 +196,11 @@ namespace HuanMeng.MiaoYu.Code.Chat Dao.daoDbMiaoYu.context.T_User_Chat.Add(userChatSession); Dao.daoDbMiaoYu.context.SaveChanges(); } - var notRole = new List(); - notRole.Add(ChatRole.initialization.ToString()); - notRole.Add(ChatRole.tips.ToString()); - var chatList = await Dao.daoDbMiaoYu.context.T_Chat.Where(it => it.SessionId == userChatSession.SessionId && it.UserId == _UserId && it.Type == (int)ChatType.正常 && !notRole.Contains(it.Role)).OrderBy(it => it.SendMessageDay).ToListAsync(); + var role = new List(); + role.Add(ChatRole.assistant.ToString()); + role.Add(ChatRole.user.ToString()); + + var chatList = await Dao.daoDbMiaoYu.context.T_Chat.Where(it => it.SessionId == userChatSession.SessionId && it.UserId == _UserId && role.Contains(it.Role)).OrderBy(it => it.SendMessageDay).ToListAsync(); if (chatList == null) { chatList = new List();