Skip to content

Commit

Permalink
Updated nuget packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha12 committed Feb 25, 2024
1 parent 693c8c7 commit ac56329
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ private async Task ProcessAsync(CreateUserMeasuresWarningParams parameters)
var moderatorId = ApiContext.GetUserId().ToString();
var payload = new MemberWarningPayload(DateTime.UtcNow, parameters.Message, parameters.GuildId, moderatorId, parameters.UserId);

await RabbitMQ.PublishAsync(MemberWarningPayload.QueueName, payload);
await RabbitMQ.PublishAsync(payload);
}
}
6 changes: 2 additions & 4 deletions src/GrillBot.App/Actions/RabbitMQPublisherAction.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GrillBot.Common.Models;
using GrillBot.Core.Infrastructure.Actions;
using GrillBot.Core.RabbitMQ;
using GrillBot.Core.RabbitMQ.Publisher;

namespace GrillBot.App.Actions;
Expand All @@ -15,10 +16,7 @@ public RabbitMQPublisherAction(ApiRequestContext apiContext, IRabbitMQPublisher

public override async Task<ApiResult> ProcessAsync()
{
var queueName = (string)Parameters[0]!;
var payload = Parameters[1];

await Publisher.PublishAsync(queueName, payload);
await Publisher.PublishAsync((IPayload)Parameters[0]!);
return ApiResult.Ok();
}
}
5 changes: 1 addition & 4 deletions src/GrillBot.App/Controllers/PointsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ public async Task<IActionResult> ServiceTransferPointsAsync(ulong guildId, ulong
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "Admin")]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> DeleteTransactionAsync(string guildId, string messageId, string? reactionId)
{
var payload = new DeleteTransactionsPayload(guildId, messageId, reactionId);
return await ProcessAsync<RabbitMQPublisherAction>(DeleteTransactionsPayload.QueueName, payload);
}
=> await ProcessAsync<RabbitMQPublisherAction>(new DeleteTransactionsPayload(guildId, messageId, reactionId));

/// <summary>
/// Gets paginated list of users.
Expand Down
5 changes: 3 additions & 2 deletions src/GrillBot.App/Managers/Points/PointsManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GrillBot.Common.Extensions.RabbitMQ;
using GrillBot.Core.RabbitMQ;
using GrillBot.Core.RabbitMQ.Publisher;

namespace GrillBot.App.Managers.Points;
Expand Down Expand Up @@ -35,7 +35,8 @@ public PointsManager(PointsSynchronizationManager synchronizationManager, Points

#region Push

public Task PushPayloadAsync<TPayload>(TPayload payload) => _rabbitPublisher.PushAsync(payload);
public Task PushPayloadAsync<TPayload>(TPayload payload) where TPayload : IPayload
=> _rabbitPublisher.PublishAsync(payload);

#endregion
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using GrillBot.Common.Extensions.Discord;
using GrillBot.Common.Extensions.RabbitMQ;
using GrillBot.Core.RabbitMQ.Publisher;
using GrillBot.Database.Enums;
using PointsModels = GrillBot.Core.Services.PointsService.Models;
Expand Down Expand Up @@ -51,6 +50,6 @@ public async Task PushAsync(IGuild guild, IEnumerable<IUser> users, IEnumerable<
}

var payload = new PointsModels.Events.SynchronizationPayload(guild.Id.ToString(), channelInfos, userInfos);
await _rabbitPublisher.PushAsync(payload);
await _rabbitPublisher.PublishAsync(payload);
}
}
7 changes: 2 additions & 5 deletions src/GrillBot.App/Managers/UnverifyRabbitMQManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ public UnverifyRabbitMQManager(IRabbitMQPublisher rabbitMQ)
}

public Task SendModifyAsync(long logSetId, DateTime newEnd)
{
var payload = new UnverifyModifyPayload(logSetId, newEnd);
return RabbitMQ.PublishAsync(UnverifyModifyPayload.QueueName, payload);
}
=> RabbitMQ.PublishAsync(new UnverifyModifyPayload(logSetId, newEnd));

public async Task SendUnverifyAsync(UnverifyUserProfile profile, UnverifyLog unverifyLog)
{
Expand All @@ -32,6 +29,6 @@ public async Task SendUnverifyAsync(UnverifyUserProfile profile, UnverifyLog unv
unverifyLog.Id
);

await RabbitMQ.PublishAsync(UnverifyPayload.QueueName, payload);
await RabbitMQ.PublishAsync(payload);
}
}

This file was deleted.

4 changes: 2 additions & 2 deletions src/GrillBot.Common/GrillBot.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<ItemGroup>
<PackageReference Include="CircularBuffer" Version="1.4.0" />
<PackageReference Include="Discord.Net" Version="3.13.1" />
<PackageReference Include="GrillBot.Core.RabbitMQ" Version="1.0.4" />
<PackageReference Include="GrillBot.Core.Services" Version="1.6.4" />
<PackageReference Include="GrillBot.Core.RabbitMQ" Version="1.0.5" />
<PackageReference Include="GrillBot.Core.Services" Version="1.6.5" />
<PackageReference Include="Humanizer.Core.cs" Version="2.14.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
Expand Down

0 comments on commit ac56329

Please sign in to comment.