-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Emote suggestions, image extension validation. * Api V2 Refactoring * AuditLogController refactoring * AuthController refactoring * DashboardController refactoring * InviteController refactoring * AutoReplyController refactoring * ChannelController refactoring * EmotesController and EmoteSuggestionController refactoring * GuildController refactoring * PointsController refactoring * PublicApiClientsController refactoring * ReminderController refactoring * ScheduledJobsController refactoring * SearchingController refactoring * ServiceController refactoring * StatisticsController refactoring * SystemController refactoring * UnverifyController refactoring * UserController refactoring * Last changes * Bugfixes after testing
- Loading branch information
Showing
125 changed files
with
2,514 additions
and
2,123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using GrillBot.Common.Models; | ||
using GrillBot.Core.Infrastructure.Actions; | ||
using GrillBot.Core.Services.Common; | ||
|
||
namespace GrillBot.App.Actions.Api; | ||
|
||
public class ServiceBridgeAction<TServiceClient> : ApiAction where TServiceClient : IClient | ||
{ | ||
private TServiceClient Client { get; } | ||
|
||
public ServiceBridgeAction(ApiRequestContext apiContext, TServiceClient client) : base(apiContext) | ||
{ | ||
Client = client; | ||
} | ||
|
||
public override async Task<ApiResult> ProcessAsync() | ||
{ | ||
var funcExecutor = Parameters.OfType<Func<TServiceClient, Task<object>>>().FirstOrDefault(); | ||
var actionExecutor = Parameters.OfType<Func<TServiceClient, Task>>().FirstOrDefault(); | ||
|
||
if (funcExecutor is not null) | ||
return ApiResult.Ok(await funcExecutor(Client)); | ||
|
||
if (actionExecutor is not null) | ||
{ | ||
await actionExecutor(Client); | ||
return ApiResult.Ok(); | ||
} | ||
|
||
return ApiResult.BadRequest(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.