You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
972 B
33 lines
972 B
using LINGYUN.Platform.Messages;
|
|
using LINGYUN.Platform.Messages.Integration;
|
|
using Volo.Abp.Sms;
|
|
using SmsMessage = Volo.Abp.Sms.SmsMessage;
|
|
|
|
namespace LY.MicroService.Applications.Single.Messages;
|
|
|
|
public class PlatformSmsSender : ISmsSender
|
|
{
|
|
private readonly ISmsMessageIntegrationService _service;
|
|
public PlatformSmsSender(ISmsMessageIntegrationService service)
|
|
{
|
|
_service = service;
|
|
}
|
|
|
|
public async virtual Task SendAsync(SmsMessage smsMessage)
|
|
{
|
|
var createInput = new SmsMessageCreateDto(
|
|
smsMessage.PhoneNumber,
|
|
smsMessage.Text);
|
|
|
|
if (smsMessage.Properties != null)
|
|
{
|
|
createInput.ExtraProperties = new ExtraPropertyDictionary();
|
|
foreach (var property in smsMessage.Properties)
|
|
{
|
|
createInput.ExtraProperties[property.Key] = property.Value;
|
|
}
|
|
}
|
|
|
|
await _service.CreateAsync(createInput);
|
|
}
|
|
}
|
|
|