修复问题

This commit is contained in:
zpc 2024-07-17 15:59:59 +08:00
parent 19f8ff16ca
commit 056b3144c5

View File

@ -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<string>();
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<string>();
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<T_Chat>();