mirror of https://github.com/abpframework/abp.git
2 changed files with 27 additions and 6 deletions
@ -1,15 +1,22 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Collections.Generic; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.Sms |
|||
{ |
|||
public class SmsMessage |
|||
{ |
|||
public string PhoneNumber { get; set; } |
|||
public string PhoneNumber { get; } |
|||
|
|||
public string Text { get; set; } |
|||
public string Text { get; } |
|||
|
|||
public IDictionary<string, object> Properties { get; set; } |
|||
public IDictionary<string, object> Properties { get; } |
|||
|
|||
public SmsMessage([NotNull] string phoneNumber, [NotNull] string text) |
|||
{ |
|||
PhoneNumber = Check.NotNullOrWhiteSpace(phoneNumber, nameof(phoneNumber)); |
|||
Text = Check.NotNullOrWhiteSpace(text, nameof(text)); |
|||
|
|||
Properties = new Dictionary<string, object>(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,14 @@ |
|||
using JetBrains.Annotations; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.Sms |
|||
{ |
|||
public static class SmsSenderExtensions |
|||
{ |
|||
public static Task SendAsync([NotNull] this ISmsSender smsSender, [NotNull] string phoneNumber, [NotNull] string text) |
|||
{ |
|||
Check.NotNull(smsSender, nameof(smsSender)); |
|||
return smsSender.SendAsync(new SmsMessage(phoneNumber, text)); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue