This commit is contained in:
King
2025-09-28 16:57:35 +03:30
parent 4241523443
commit 9fcc5d9276
24 changed files with 961 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
@@ -20,6 +20,7 @@
<ItemGroup>
<ProjectReference Include="..\BackOffice.BFF.Application\BackOffice.BFF.Application.csproj" />
<ProjectReference Include="..\BackOffice.BFF.Infrastructure\BackOffice.BFF.Infrastructure.csproj" />
<ProjectReference Include="..\Protobufs\BackOffice.BFF.Otp.Protobuf\BackOffice.BFF.Otp.Protobuf.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Protobufs\BackOffice.BFF.User.Protobuf\BackOffice.BFF.User.Protobuf.csproj" />

View File

@@ -0,0 +1,10 @@
namespace BackOffice.BFF.WebApi.Common.Mappings;
public class OtpProfile : IRegister
{
void IRegister.Register(TypeAdapterConfig config)
{
//config.NewConfig<Source,Destination>()
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
}
}

View File

@@ -0,0 +1,22 @@
using BackOffice.BFF.Otp.Protobuf.Protos.Otp;
using BackOffice.BFF.WebApi.Common.Services;
using BackOffice.BFF.Application.OtpCQ.Commands.SendOtp;
using BackOffice.BFF.Application.OtpCQ.Commands.VerifyOtpCode;
namespace BackOffice.BFF.WebApi.Services;
public class OtpService : OtpContract.OtpContractBase
{
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
public OtpService(IDispatchRequestToCQRS dispatchRequestToCQRS)
{
_dispatchRequestToCQRS = dispatchRequestToCQRS;
}
public override async Task<Empty> SendOtp(SendOtpRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<SendOtpRequest, SendOtpCommand>(request, context);
}
public override async Task<VerifyOtpCodeResponse> VerifyOtpCode(VerifyOtpCodeRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<VerifyOtpCodeRequest, VerifyOtpCodeCommand, VerifyOtpCodeResponse>(request, context);
}
}

View File

@@ -20,5 +20,9 @@
"Authentication": {
"Authority": "https://ids.domain.com/",
"Audience": "domain_api"
},
"Kavenegar": {
"Sender": "1000001110100",
"ApiKey": "497263626F32626A48685A6137524C4F78575A766E4C74694A556B79317648424964655030682B554545413D"
}
}