Merge branch 'master' of https://gitea.nxsir.cn/nanxun/IM_NEW
This commit is contained in:
@@ -39,5 +39,17 @@ namespace MessageService.WebApi.Application.Conversation
|
||||
var list = await reposity.FindAllStreamKeyAsync(userId);
|
||||
return Result.Success(list.ToList());
|
||||
}
|
||||
|
||||
public async Task<Result<object>> MarkAsReadAsync(Guid conversationId, Guid userId)
|
||||
{
|
||||
var conversation = await reposity.FindByIdAsync(conversationId);
|
||||
if (conversation is null || conversation.UserId != userId)
|
||||
{
|
||||
return Result.Fail<object>(ResultCode.CONVERSATION_NOT_FOUND);
|
||||
}
|
||||
|
||||
conversation.MarkAsRead(lastReadSequenceId: null);
|
||||
return Result.Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ namespace MessageService.WebApi.Application.EventHandlers
|
||||
reposity.Create(new Domain.Entities.Conversation(
|
||||
userId: @event.UserId,
|
||||
targetId: @event.GroupId,
|
||||
targetAvatar: @event.Avatar,
|
||||
targetName: @event.GroupNickName,
|
||||
targetAvatar: @event.GroupAvatar ?? @event.Avatar,
|
||||
targetName: @event.GroupName,
|
||||
lastReadSequenceId: null,
|
||||
unreadCount:0,
|
||||
chatType: Domain.Enums.ChatType.GROUP,
|
||||
|
||||
+7
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
using System.Net.Http.Json;
|
||||
using IM.Commons;
|
||||
|
||||
namespace MessageService.WebApi.Application.IntegrationServices
|
||||
@@ -6,6 +6,12 @@ namespace MessageService.WebApi.Application.IntegrationServices
|
||||
public class GroupMemberIntegrationService : IGroupMemberIntegrationService
|
||||
{
|
||||
private readonly HttpClient http;
|
||||
|
||||
public GroupMemberIntegrationService(HttpClient http)
|
||||
{
|
||||
this.http = http;
|
||||
}
|
||||
|
||||
public async Task<bool> CheckGroupMemberAsync(Guid userId, Guid groupId)
|
||||
{
|
||||
var result = await http.GetFromJsonAsync<Result<bool>>(
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace MessageService.WebApi.Application.Message
|
||||
}
|
||||
message.WithQuote(quote);
|
||||
}
|
||||
message.Send();
|
||||
reposity.Create(message);
|
||||
|
||||
return Result.Success(mapper.Map<MessageResponse>(message));
|
||||
|
||||
Reference in New Issue
Block a user