feat: finalize core modules and gateway
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using TakeoutSaaS.Module.Sms;
|
||||
|
||||
namespace TakeoutSaaS.Application.Sms.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// 发送验证码请求。
|
||||
/// </summary>
|
||||
public sealed class SendVerificationCodeRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建发送请求。
|
||||
/// </summary>
|
||||
public SendVerificationCodeRequest(string phoneNumber, string scene, SmsProviderKind? provider = null)
|
||||
{
|
||||
PhoneNumber = phoneNumber;
|
||||
Scene = scene;
|
||||
Provider = provider;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 手机号(支持 +86 前缀或纯 11 位)。
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务场景(如 login/register/reset)。
|
||||
/// </summary>
|
||||
public string Scene { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 指定服务商,未指定则使用默认配置。
|
||||
/// </summary>
|
||||
public SmsProviderKind? Provider { get; }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace TakeoutSaaS.Application.Sms.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// 发送验证码响应。
|
||||
/// </summary>
|
||||
public sealed class SendVerificationCodeResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 过期时间。
|
||||
/// </summary>
|
||||
public DateTimeOffset ExpiresAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求标识。
|
||||
/// </summary>
|
||||
public string? RequestId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace TakeoutSaaS.Application.Sms.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// 校验验证码请求。
|
||||
/// </summary>
|
||||
public sealed class VerifyVerificationCodeRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建校验请求。
|
||||
/// </summary>
|
||||
public VerifyVerificationCodeRequest(string phoneNumber, string scene, string code)
|
||||
{
|
||||
PhoneNumber = phoneNumber;
|
||||
Scene = scene;
|
||||
Code = code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 手机号。
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务场景。
|
||||
/// </summary>
|
||||
public string Scene { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 填写的验证码。
|
||||
/// </summary>
|
||||
public string Code { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user