22 lines
684 B
C#
22 lines
684 B
C#
using DbusSmsForward.ProcessSmsContent;
|
|
using DbusSmsForward.SMSModel;
|
|
using DbusSmsForward.SettingModel;
|
|
|
|
namespace DbusSmsForward.Services;
|
|
|
|
public static class NotificationContentBuilder
|
|
{
|
|
public static string BuildBody(SmsContentModel sms, string deviceName)
|
|
=> $"发信电话:{sms.TelNumber}\n时间:{sms.SmsDate}\n转发设备:{deviceName}\n短信内容:{sms.SmsContent}";
|
|
|
|
public static SmsCodeModel ExtractCode(DbusSmsForwardOptions options, SmsContentModel sms)
|
|
{
|
|
if (!options.Forwarding.EnableSmsCodeExtraction)
|
|
{
|
|
return new SmsCodeModel();
|
|
}
|
|
|
|
return GetSmsContentCode.GetSmsCodeModel(sms.SmsContent);
|
|
}
|
|
}
|