Update
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user