first commit
This commit is contained in:
50
Complex.Application/Services/Utility/ISendUserMessage.cs
Normal file
50
Complex.Application/Services/Utility/ISendUserMessage.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Complex.Application.Services.Utility
|
||||
{
|
||||
public interface ISendUserMessage
|
||||
{
|
||||
Task<Response<SendData>> Send(object message, string[] MobileNumber);
|
||||
Task<Response<SendData>> SendPattern(string patternCode, string MobileNumber, object values);
|
||||
}
|
||||
public class Response<T> where T : Data
|
||||
{
|
||||
public string status { get; set; }
|
||||
public string code { get; set; }
|
||||
public string message { get; set; }
|
||||
public T data { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JsonSerializer.Serialize(this);
|
||||
}
|
||||
|
||||
public bool IsSuccessful
|
||||
{
|
||||
get
|
||||
{
|
||||
return data != null && data.error == null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Data
|
||||
{
|
||||
public string error { get; set; }
|
||||
}
|
||||
|
||||
public class SendResponse : Response<SendData>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class SendData : Data
|
||||
{
|
||||
public string bulk_id { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user