@@ -1,22 +1,22 @@
|
||||
using IM_API.Domain.Events;
|
||||
using IM_API.Interface.Services;
|
||||
using MassTransit;
|
||||
|
||||
namespace IM_API.Application.EventHandlers.GroupJoinHandler
|
||||
{
|
||||
public class GroupJoinDbHandler : IConsumer<GroupJoinEvent>
|
||||
{
|
||||
private readonly IGroupService _groupService;
|
||||
public GroupJoinDbHandler(IGroupService groupService)
|
||||
{
|
||||
_groupService = groupService;
|
||||
}
|
||||
|
||||
public async Task Consume(ConsumeContext<GroupJoinEvent> context)
|
||||
{
|
||||
await _groupService.MakeGroupMemberAsync(context.Message.UserId,
|
||||
context.Message.GroupId, context.Message.IsCreated ?
|
||||
Models.GroupMemberRole.Master : Models.GroupMemberRole.Normal);
|
||||
}
|
||||
}
|
||||
}
|
||||
using IM_API.Domain.Events;
|
||||
using IM_API.Interface.Services;
|
||||
using MassTransit;
|
||||
|
||||
namespace IM_API.Application.EventHandlers.GroupJoinHandler
|
||||
{
|
||||
public class GroupJoinDbHandler : IConsumer<GroupJoinEvent>
|
||||
{
|
||||
private readonly IGroupService _groupService;
|
||||
public GroupJoinDbHandler(IGroupService groupService)
|
||||
{
|
||||
_groupService = groupService;
|
||||
}
|
||||
|
||||
public async Task Consume(ConsumeContext<GroupJoinEvent> context)
|
||||
{
|
||||
await _groupService.MakeGroupMemberAsync(context.Message.UserId,
|
||||
context.Message.GroupId, context.Message.IsCreated ?
|
||||
Models.GroupMemberRole.Master : Models.GroupMemberRole.Normal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user