30 lines
926 B
C#
30 lines
926 B
C#
using RestSharp;
|
|
|
|
namespace IotManager.Common
|
|
{
|
|
public class MsgSend
|
|
{
|
|
public static string BaseUrl = "http://blv-rd.tech:19041";
|
|
public static async Task SendMsg(MsgData data)
|
|
{
|
|
var options = new RestClientOptions(BaseUrl);
|
|
var client = new RestClient(options);
|
|
|
|
var request = new RestRequest("/api/CallAndMsg/SendToPhone");
|
|
request.AddBody(data, ContentType.Json);
|
|
|
|
RestResponse response = await client.ExecuteAsync(request, Method.Post);
|
|
string? allow_or_deny = response.Content;
|
|
}
|
|
}
|
|
public class MsgData
|
|
{
|
|
public string? PhoneNumber { get; set; }
|
|
public string? CallerName { get; set; }
|
|
public string? Content { get; set; }
|
|
public string? StartingPoint { get; set; }
|
|
public string? DeadLine { get; set; }
|
|
public string? Type { get; set; }
|
|
}
|
|
}
|