From 5035bab4a45ca5b3dd485157dd223d11c46c0c40 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Fri, 13 Nov 2026 19:00:33 +0330 Subject: [PATCH] Rename XBotProvider Controller ... --- Controllers/XBotProviderController.cs | 151 +++++++++----------------- 1 file changed, 52 insertions(+), 99 deletions(-) diff --git a/Controllers/XBotProviderController.cs b/Controllers/XBotProviderController.cs index db001e6..3eac901 100644 --- a/Controllers/XBotProviderController.cs +++ b/Controllers/XBotProviderController.cs @@ -12,25 +12,28 @@ using System.Collections.Generic; using xIdentityService.Interfaces; using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Authorization; +using xBotService.Reciever; namespace xServices.Controllers { [Authorize] [RequireXPowered] - public class XBotProviderController : XBotProviderControllerBase + public class BotController : XBotProviderControllerBase { - public XBotProviderController( + public BotController( IXBotProvider botProvider, + ILogger logger, XAppConfiguration appConfiguration, IXIdentityProvider identityProvider, XValidationProvider validationProvider, - ILogger logger + XBotBotUpdateRecieverBackgroundService botHandler ) : base( - botProvider, - logger, - appConfiguration, - identityProvider, - validationProvider + logger: logger, + botHandler: botHandler, + botProvider: botProvider, + appConfiguration: appConfiguration, + identityProvider: identityProvider, + validationProvider: validationProvider ) { } @@ -85,102 +88,52 @@ namespace xServices.Controllers return result; } - // [HttpPost("{chatId}/ShowVerificationMenu")] - // [Authorize(Policy = XPolicies.EnabledAdmin)] - // public override async Task> ShowVerificationMenu( - // [FromRoute] long chatId, - // CancellationToken cancellationToken = default - // ) - // { - // // - // var result = await base.ShowVerificationMenu( - // chatId: chatId, - // cancellationToken: cancellationToken - // ); + [Authorize(Policy = XPolicies.EnabledAdmin)] + [HttpPost("{botUserId}/ShowVerificationMenu")] + public override async Task> ShowVerificationMenu( + [FromRoute] long botUserId, + CancellationToken cancellationToken = default + ) + { + // + var result = await base.ShowVerificationMenu( + botUserId: botUserId, + cancellationToken: cancellationToken + ); - // // - // return result; - // } + // + return result; + } - // [HttpPost("{chatId}/SendVerificationCode")] - // [Authorize(Policy = XPolicies.EnabledAdmin)] - // public override async Task> SendVerificationCode( - // [FromRoute] long chatId, - // [FromQuery] string code, - // [FromQuery] int ttlSeconds, - // CancellationToken cancellationToken = default - // ) - // { - // // - // var result = await base.SendVerificationCode( - // code: code, - // chatId: chatId, - // ttlSeconds: ttlSeconds, - // cancellationToken: cancellationToken - // ); + [HttpPost("{token}/VerifyUser")] + [Authorize(Policy = XPolicies.EnabledUser)] + public override async Task> VerifyUser( + [FromRoute] string token, + CancellationToken cancellationToken = default + ) + { + // + var result = await base.VerifyUser( + token: token, + cancellationToken: cancellationToken + ); - // // - // return result; - // } + // + return result; + } - // [HttpPost("{id}/AnswerCallback")] - // [Authorize(Policy = XPolicies.EnabledAdmin)] - // public override async Task> AnswerCallbackQuery( - // [FromRoute] string callbackQueryId, - // [FromQuery] string text = null, - // [FromQuery] bool showAlert = false, - // CancellationToken cancellationToken = default - // ) - // { - // // - // var result = await base.AnswerCallbackQuery( - // text: text, - // showAlert: showAlert, - // callbackQueryId: callbackQueryId, - // cancellationToken: cancellationToken - // ); + [HttpPost("Refresh")] + [Authorize(Policy = XPolicies.EnabledAdmin)] + public override async Task Refresh( + CancellationToken cancellationToken = default + ) + { + // + var result = await base.Refresh(cancellationToken); - // // - // return result; - // } - - // [HttpPost("{chatId}/RemoveInlineKeyboard")] - // [Authorize(Policy = XPolicies.EnabledAdmin)] - // public override async Task> RemoveInlineKeyboard( - // [FromRoute] long chatId, - // [FromQuery] long messageId, - // CancellationToken cancellationToken = default - // ) - // { - // // - // var result = await base.RemoveInlineKeyboard( - // chatId: chatId, - // messageId: messageId, - // cancellationToken: cancellationToken - // ); - - // // - // return result; - // } - - // [HttpPost("Webhook")] - // [Authorize(Policy = XPolicies.EnabledAdmin)] - // public override async Task> SetWebhook( - // [FromQuery] string webhookUrl, - // [FromQuery] string secretToken = null, - // CancellationToken cancellationToken = default - // ) - // { - // // - // var result = await base.SetWebhook( - // webhookUrl: webhookUrl, - // secretToken: secretToken, - // cancellationToken: cancellationToken - // ); - - // // - // return result; - // } + // + return result; + } #endregion } } \ No newline at end of file