pull/20/head
chencaixia 2 months ago
parent 057ae47e58
commit 7fe004e21f
  1. 2
      WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/Controllers/ParkLotInfoController.cs
  2. 6
      WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/HostService/PingService .cs

@ -45,7 +45,7 @@ namespace ParkingLotService.API.Controllers
/// <param name="doorId"></param>
/// <param name="command"></param>
/// <returns></returns>
[HttpPost]
[HttpGet]
public async Task<ApiResult<int>> DoorLockSendCommand(int doorId, string command)
{
return await _parkingLotDataService.DoorLockSendCommand(doorId, command);

@ -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

Loading…
Cancel
Save