51 lines
1.1 KiB
C#
51 lines
1.1 KiB
C#
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; }
|
|
}
|
|
}
|