Compare commits

..
9 Commits
Author SHA1 Message Date
saherelm 7d91d92c70 last ... 2026-11-24 10:44:44 +03:30
saherelm 08cab60c36 last ... 2026-11-24 08:24:59 +03:30
saherelm 85b16cb80e add Test using XKeyedServices ... 2026-11-23 16:45:24 +03:30
saherelm 199ee757c7 last ... 2026-11-20 20:23:48 +03:30
saherelm 3a6fc3b98d last ... 2026-11-20 14:42:44 +03:30
saherelm 5875c766a1 add xMQ5ZQBridge ... 2026-11-20 14:11:17 +03:30
saherelm 5035bab4a4 Rename XBotProvider Controller ... 2026-11-13 19:00:33 +03:30
saherelm 7885a6b629 adding support of Bot Service Usage ... 2026-11-12 20:18:19 +03:30
saherelm 0a641f4117 Cleaning Up ... 2026-11-11 19:22:45 +03:30
4 changed files with 147 additions and 6 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
namespace xServices.Configurations
{
public partial class XServicesConfiguration
{ }
{
public string Name { get; set; } = "Default";
}
}
+139
View File
@@ -0,0 +1,139 @@
using xIdentityHelper;
using System.Threading;
using xBotService.Models;
using xCommons.Providers;
using xCommons.Attributes;
using System.Threading.Tasks;
using xBotService.Interfaces;
using xBotService.Controllers;
using xCommons.Configurations;
using Microsoft.AspNetCore.Mvc;
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 BotController : XBotProviderControllerBase
{
public BotController(
IXBotProvider botProvider,
ILogger<BotController> logger,
XAppConfiguration appConfiguration,
IXIdentityProvider identityProvider,
XValidationProvider validationProvider,
XBotBotUpdateRecieverBackgroundService botHandler
) : base(
logger: logger,
botHandler: botHandler,
botProvider: botProvider,
appConfiguration: appConfiguration,
identityProvider: identityProvider,
validationProvider: validationProvider
)
{ }
//
#region Override ...
[HttpGet("Me")]
[Authorize(Policy = XPolicies.EnabledAdmin)]
public override async Task<ActionResult<XBotResUser>> GetMe(
CancellationToken cancellationToken = default
)
{
//
var result = await base.GetMe(
cancellationToken: cancellationToken
);
//
return result;
}
[HttpGet("Updates")]
[Authorize(Policy = XPolicies.EnabledAdmin)]
public override async Task<ActionResult<IList<XBotUpdateResponse>>> GetUpdates(
[FromQuery] XBotUpdatesRequest request,
CancellationToken cancellationToken = default
)
{
//
var result = await base.GetUpdates(
request: request,
cancellationToken: cancellationToken
);
//
return result;
}
[HttpPost("Message")]
[Authorize(Policy = XPolicies.EnabledAdmin)]
public override async Task<ActionResult<XBotMessage>> SendMessage(
[FromBody] XBotSendMessageRequest request,
CancellationToken cancellationToken = default
)
{
//
var result = await base.SendMessage(
request: request,
cancellationToken: cancellationToken
);
//
return result;
}
[Authorize(Policy = XPolicies.EnabledAdmin)]
[HttpPost("{botUserId}/ShowVerificationMenu")]
public override async Task<ActionResult<XBotMessage>> ShowVerificationMenu(
[FromRoute] long botUserId,
CancellationToken cancellationToken = default
)
{
//
var result = await base.ShowVerificationMenu(
botUserId: botUserId,
cancellationToken: cancellationToken
);
//
return result;
}
[HttpPost("{token}/VerifyUser")]
[Authorize(Policy = XPolicies.EnabledUser)]
public override async Task<ActionResult<XBotMessage>> VerifyUser(
[FromRoute] string token,
CancellationToken cancellationToken = default
)
{
//
var result = await base.VerifyUser(
token: token,
cancellationToken: cancellationToken
);
//
return result;
}
[HttpPost("Refresh")]
[Authorize(Policy = XPolicies.EnabledAdmin)]
public override async Task<ActionResult> Refresh(
CancellationToken cancellationToken = default
)
{
//
var result = await base.Refresh(cancellationToken);
//
return result;
}
#endregion
}
}
+1 -2
View File
@@ -350,7 +350,7 @@ namespace xServices.DI
services.AddXBotService<XApiDbContext>(
lifeTime: lifeTime,
configuration: configuration,
repositoryType: repositoryType
repositoryType: repositoryType
);
//
@@ -370,7 +370,6 @@ namespace xServices.DI
//
// Register Content Service ...
// services.AddXContentServiceConfiguration(configuration);
services.AddXContentService<XApiDbContext>(
lifeTime: lifeTime,
repositoryType: repositoryType
+4 -3
View File
@@ -32,20 +32,21 @@
<ItemGroup>
<ProjectReference Include="..\xCommons\xCommons.csproj" />
<ProjectReference Include="..\xBotService\xBotService.csproj" />
<ProjectReference Include="..\xTagService\xTagService.csproj" />
<ProjectReference Include="..\xDataService\xDataService.csproj" />
<ProjectReference Include="..\xPushService\xPushService.csproj" />
<ProjectReference Include="..\xFileService\xFileService.csproj" />
<!-- <ProjectReference Include="..\XAiService\XAiService.csproj" /> -->
<!-- <ProjectReference Include="..\xDataHelper\xDataHelper.csproj" /> -->
<!-- <ProjectReference Include="..\xPushHelper\xPushHelper.csproj" /> -->
<ProjectReference Include="..\xTagService\xTagService.csproj" />
<ProjectReference Include="..\xFileService\xFileService.csproj" />
<ProjectReference Include="..\xStringService\xStringService.csproj" />
<ProjectReference Include="..\XContentService\XContentService.csproj" />
<ProjectReference Include="..\xIdentityHelper\xIdentityHelper.csproj" />
<ProjectReference Include="..\xMessageService\xMessageService.csproj" />
<ProjectReference Include="..\xStorageService\xStorageService.csproj" />
<ProjectReference Include="..\xCategoryService\xCategoryService.csproj" />
<ProjectReference Include="..\xWebinarService\xWebinarService.csproj" />
<ProjectReference Include="..\xCategoryService\xCategoryService.csproj" />
<ProjectReference Include="..\xMT5BridgeService\xMT5BridgeService.csproj" />
<ProjectReference Include="..\xTermsAndConditionsService\xTermsAndConditionsService.csproj" />
</ItemGroup>