Update
This commit is contained in:
@@ -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" />
|
||||
|
||||
10
src/BackOffice.BFF.WebApi/Common/Mappings/OtpProfile.cs
Normal file
10
src/BackOffice.BFF.WebApi/Common/Mappings/OtpProfile.cs
Normal 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}");
|
||||
}
|
||||
}
|
||||
22
src/BackOffice.BFF.WebApi/Services/OtpService.cs
Normal file
22
src/BackOffice.BFF.WebApi/Services/OtpService.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -20,5 +20,9 @@
|
||||
"Authentication": {
|
||||
"Authority": "https://ids.domain.com/",
|
||||
"Audience": "domain_api"
|
||||
},
|
||||
"Kavenegar": {
|
||||
"Sender": "1000001110100",
|
||||
"ApiKey": "497263626F32626A48685A6137524C4F78575A766E4C74694A556B79317648424964655030682B554545413D"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user