[FA-misc] Mass transit overhaul, needs testing and review
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using FictionArchive.Service.AuthenticationService.Models.Requests;
|
||||
using FictionArchive.Service.AuthenticationService.Models.IntegrationEvents;
|
||||
using FictionArchive.Service.Shared.Services.EventBus;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using FictionArchive.Service.Shared.MassTransit.Contracts.Events;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace FictionArchive.Service.AuthenticationService.Controllers
|
||||
@@ -10,11 +9,11 @@ namespace FictionArchive.Service.AuthenticationService.Controllers
|
||||
[ApiController]
|
||||
public class AuthenticationWebhookController : ControllerBase
|
||||
{
|
||||
private readonly IEventBus _eventBus;
|
||||
private readonly IPublishEndpoint _publishEndpoint;
|
||||
|
||||
public AuthenticationWebhookController(IEventBus eventBus)
|
||||
public AuthenticationWebhookController(IPublishEndpoint publishEndpoint)
|
||||
{
|
||||
_eventBus = eventBus;
|
||||
_publishEndpoint = publishEndpoint;
|
||||
}
|
||||
|
||||
[HttpPost(nameof(UserRegistered))]
|
||||
@@ -28,7 +27,7 @@ namespace FictionArchive.Service.AuthenticationService.Controllers
|
||||
EventUserUsername = payload.EventUserUsername
|
||||
};
|
||||
|
||||
await _eventBus.Publish(authUserAddedEvent);
|
||||
await _publishEndpoint.Publish(authUserAddedEvent);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user