forked from xiongyuxing/tiku-backend.net
30 lines
733 B
C#
30 lines
733 B
C#
using Tiku.Domain.Tenancy;
|
|
|
|
namespace Tiku.Application.Auth;
|
|
|
|
public sealed record SmsProviderSendRequest(
|
|
Guid TenantId,
|
|
string Phone,
|
|
SmsPurpose Purpose,
|
|
string Code,
|
|
string? IpAddress,
|
|
string? UserAgent);
|
|
|
|
public sealed record SmsProviderSendResult(
|
|
string Provider,
|
|
string Status,
|
|
string? MessageId = null);
|
|
|
|
public sealed class SmsProviderException(string message, string code, Exception? innerException = null)
|
|
: AuthException(code, message)
|
|
{
|
|
public Exception? ProviderException { get; } = innerException;
|
|
}
|
|
|
|
public interface ISmsProvider
|
|
{
|
|
Task<SmsProviderSendResult> SendAsync(
|
|
SmsProviderSendRequest request,
|
|
CancellationToken cancellationToken = default);
|
|
}
|