初始化
This commit is contained in:
29
BooliveMQTT_Auth/Common/MsgSend.cs
Normal file
29
BooliveMQTT_Auth/Common/MsgSend.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user