fix:修复已知问题
This commit is contained in:
@@ -42,7 +42,7 @@ namespace IM_API.Services
|
||||
var groupList = await (from c in _context.Conversations
|
||||
join g in _context.Groups on c.TargetId equals g.Id
|
||||
where c.UserId == userId && c.ChatType == ChatType.GROUP
|
||||
select new { c, g.Avatar, g.Name })
|
||||
select new { c, g.Avatar, g.Name,g.MaxSequenceId,g.LastMessage })
|
||||
.ToListAsync();
|
||||
|
||||
var privateDtos = privateList.Select(x =>
|
||||
@@ -58,6 +58,9 @@ namespace IM_API.Services
|
||||
var dto = _mapper.Map<ConversationVo>(x.c);
|
||||
dto.TargetAvatar = x.Avatar;
|
||||
dto.TargetName = x.Name;
|
||||
dto.UnreadCount = (int)(x.MaxSequenceId - x.c.LastReadSequenceId ?? 0);
|
||||
dto.LastSequenceId = x.MaxSequenceId;
|
||||
dto.LastMessage = x.LastMessage;
|
||||
return dto;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user