You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
902 B

using log4net;
using Newtonsoft.Json;
using Service.Execute.Model;
using Service.Rfid;
namespace Service.Execute.Api;
public class RfidApi
{
private static readonly ILog Log = LogManager.GetLogger(typeof(RfidApi));
//TODO::Rfid 服务地址
private static readonly string BASE_URL = "http://localhost:7243";
private static readonly HttpClient _httpClient = new HttpClient()
{
Timeout = TimeSpan.FromSeconds(60)
};
public static async Task<bool> BeginRead()
{
Log.Info("BeginRead");
return RfidMgr.BeginRead();
}
public static async Task<bool> StopRead()
{
Log.Info("StopRead");
string url = BASE_URL + "/Api/StopRead";
return RfidMgr.StopRead();
}
public static async Task<RfidReadModel?> ReadRifd()
{
Log.Info("ReadRifd");
return RfidMgr.ReadRifd();
}
}