[FA-misc] Mass transit overhaul, needs testing and review
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using FictionArchive.Service.Shared.Services.EventBus;
|
||||
using FictionArchive.Service.Shared.MassTransit.Contracts.Events;
|
||||
using FictionArchive.Service.UserService.Models.Database;
|
||||
using FictionArchive.Service.UserService.Models.IntegrationEvents;
|
||||
using FictionArchive.Service.UserService.Services.AuthenticationClient;
|
||||
using MassTransit;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FictionArchive.Service.UserService.Services;
|
||||
@@ -11,18 +11,18 @@ public class UserManagementService
|
||||
private readonly ILogger<UserManagementService> _logger;
|
||||
private readonly UserServiceDbContext _dbContext;
|
||||
private readonly IAuthenticationServiceClient _authClient;
|
||||
private readonly IEventBus _eventBus;
|
||||
private readonly IPublishEndpoint _publishEndpoint;
|
||||
|
||||
public UserManagementService(
|
||||
UserServiceDbContext dbContext,
|
||||
ILogger<UserManagementService> logger,
|
||||
IAuthenticationServiceClient authClient,
|
||||
IEventBus eventBus)
|
||||
IPublishEndpoint publishEndpoint)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_logger = logger;
|
||||
_authClient = authClient;
|
||||
_eventBus = eventBus;
|
||||
_publishEndpoint = publishEndpoint;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -99,7 +99,7 @@ public class UserManagementService
|
||||
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
await _eventBus.Publish(new UserInvitedEvent
|
||||
await _publishEndpoint.Publish(new UserInvitedEvent
|
||||
{
|
||||
InvitedUserId = newUser.Id,
|
||||
InvitedUsername = newUser.Username,
|
||||
|
||||
Reference in New Issue
Block a user