|
|
|
|
@ -11,7 +11,7 @@ namespace ParkingLotService.API.HostService |
|
|
|
|
{ |
|
|
|
|
private readonly ILogger<PingService> _logger; |
|
|
|
|
private readonly IServiceScopeFactory _serviceScopeFactory; |
|
|
|
|
private readonly string _ipAddress; |
|
|
|
|
// private readonly string _ipAddress; |
|
|
|
|
private readonly IConfiguration _configuration; |
|
|
|
|
private Timer _timer; |
|
|
|
|
private bool _isTaskRunning; |
|
|
|
|
@ -19,7 +19,7 @@ namespace ParkingLotService.API.HostService |
|
|
|
|
public PingService(ILogger<PingService> logger, IServiceScopeFactory serviceScopeFactory, IConfiguration configuration) |
|
|
|
|
{ |
|
|
|
|
_logger = logger; |
|
|
|
|
_ipAddress = "8.8.8.8"; // 替换为你要ping的IP |
|
|
|
|
//_ipAddress = "8.8.8.8"; // 替换为你要ping的IP |
|
|
|
|
_serviceScopeFactory = serviceScopeFactory; |
|
|
|
|
_timer = new Timer(DoWork, null, Timeout.Infinite, Timeout.Infinite); |
|
|
|
|
_configuration = configuration; |
|
|
|
|
@ -49,7 +49,7 @@ namespace ParkingLotService.API.HostService |
|
|
|
|
//门禁的门开关等状态 |
|
|
|
|
var myAddress = _configuration["MyApiAddress"];//本地地址,第三方需要回调的地址 |
|
|
|
|
//门的开关记录 |
|
|
|
|
// await service.PushLifangDoorData("SUBSCRIBE:MJ_DOOR_STATUS_EVENT", $"{myAddress}/api/ParkLotInfo/PostDoorControlRecord", tokenStr); |
|
|
|
|
await service.PushLifangDoorData("SUBSCRIBE:MJ_DOOR_STATUS_EVENT", $"{myAddress}/api/ParkLotInfo/PostDoorControlRecord", tokenStr); |
|
|
|
|
//门禁设备在线状态 |
|
|
|
|
await service.PushLifangDoorData("SUBSCRIBE:DEVICE_ONLINE_EVENT", $"{myAddress}/api/ParkLotInfo/PostDoorEqState", tokenStr); |
|
|
|
|
#endregion |
|
|
|
|
|