fix:修复已知问题

This commit is contained in:
2026-02-09 15:46:40 +08:00
parent 10f79fb537
commit dc6ecf224d
29 changed files with 1530 additions and 37 deletions
@@ -18,15 +18,18 @@ namespace IM_API.Application.EventHandlers.MessageCreatedHandler
private readonly IConversationService _conversationService;
private readonly ILogger<ConversationEventHandler> _logger;
private readonly IUserService _userSerivce;
private readonly IGroupService _groupService;
public ConversationEventHandler(
IConversationService conversationService,
ILogger<ConversationEventHandler> logger,
IUserService userService
IUserService userService,
IGroupService groupService
)
{
_conversationService = conversationService;
_logger = logger;
_userSerivce = userService;
_groupService = groupService;
}
public async Task Consume(ConsumeContext<MessageCreatedEvent> context)
@@ -35,14 +38,13 @@ namespace IM_API.Application.EventHandlers.MessageCreatedHandler
if (@event.ChatType == ChatType.GROUP)
{
var userinfo = await _userSerivce.GetUserInfoAsync(@event.MsgSenderId);
await _conversationService.UpdateConversationAfterSentAsync(new Dtos.Conversation.UpdateConversationDto
await _groupService.UpdateGroupConversationAsync(new Dtos.Group.GroupUpdateConversationDto
{
LastMessage = $"{userinfo.NickName}{@event.MessageContent}",
LastSequenceId = @event.SequenceId,
ReceiptId = @event.MsgRecipientId,
SenderId = @event.MsgSenderId,
StreamKey = @event.StreamKey,
DateTime = @event.MessageCreated
GroupId = @event.MsgRecipientId,
LastMessage = @event.MessageContent,
LastSenderName = userinfo.NickName,
LastUpdateTime = @event.MessageCreated,
MaxSequenceId = @event.SequenceId
});
}
else