20023-08-10

This commit is contained in:
2023-08-10 11:40:02 +08:00
parent c41b3b9777
commit 02fcf5be10
82 changed files with 9031 additions and 2997 deletions
+38 -2
View File
@@ -1,11 +1,14 @@
namespace BLL
{
using Model;
using Quartz;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
@@ -30,7 +33,11 @@ namespace BLL
return dataBaseLinkList;
}
}
public static IScheduler ScheduledTasks
{
get;
set;
}
/// <summary>
/// 数据库连接字符串
@@ -1239,7 +1246,36 @@ namespace BLL
return date;
//return TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddSeconds(timestamp);
}
}
public static string RequestGet(string Baseurl, string Token)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var client = new RestClient(Baseurl);
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("token", Token);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
return response.Content;
}
public static string RequestPost(string Baseurl, string Token, string JsonBody)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var client = new RestClient(Baseurl);
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("token", Token);
if (!string.IsNullOrEmpty(JsonBody))
{
request.AddJsonBody(JsonBody);
}
IRestResponse response = client.Execute(request);
return response.Content;
}
}
}