[FA-misc] Mass transit overhaul, needs testing and review

This commit is contained in:
gamer147
2026-01-21 23:16:31 -05:00
parent 055ef33666
commit f88f340d0a
97 changed files with 1150 additions and 858 deletions

View File

@@ -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();
}