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.
72 lines
1.9 KiB
72 lines
1.9 KiB
using Common.Models.Notification;
|
|
using Common.Models.RequestResponse;
|
|
using Common.Models.SendSMS;
|
|
using Common.Utility;
|
|
using log4net;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Net.Http;
|
|
using System.Net.Http.Headers;
|
|
using System.Net.Mail;
|
|
using System.Net.Mime;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Business.BusinessLogic.NotificationApiService
|
|
{
|
|
public class NotificationService : INotificationService
|
|
{
|
|
private readonly ILog _log = LogManager.GetLogger(typeof(NotificationService));
|
|
|
|
|
|
public NotificationService()
|
|
{
|
|
|
|
}
|
|
|
|
public TPResponse NotificationApiMethod(SendNotificationRequest model)
|
|
{
|
|
var map = Helpers.GetMapping(Common.Models.Enums.MappingType.NOTIFICATION_TYPE, model.NotificationTypeId);
|
|
|
|
var response = new TPResponse();
|
|
switch (map.DValue)
|
|
{
|
|
case "P":
|
|
response = new FireBaseService().PushNotify(model);
|
|
break;
|
|
case "E":
|
|
response = new EmailService().SendEmail(model);
|
|
break;
|
|
case "S":
|
|
response = SendSMS(model);
|
|
break;
|
|
default:
|
|
response = new TPResponse() { ResponseCode = "1", Msg = "No Method Found." };
|
|
break;
|
|
}
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
private TPResponse SendSMS(SendNotificationRequest model)
|
|
{
|
|
TPResponse _tPResponse = new TPResponse() { ResponseCode = "1" };
|
|
|
|
|
|
return _tPResponse;
|
|
}
|
|
private TPResponse SendPushNotification(SendNotificationRequest model)
|
|
{
|
|
TPResponse _tPResponse = new TPResponse() { ResponseCode = "1" };
|
|
|
|
|
|
return _tPResponse;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|