diff --git a/projects/IoT/IoTServices/FBeeService/Controllers/IrController.cs b/projects/IoT/IoTServices/FBeeService/Controllers/IrController.cs index d68ac407..27e26b32 100644 --- a/projects/IoT/IoTServices/FBeeService/Controllers/IrController.cs +++ b/projects/IoT/IoTServices/FBeeService/Controllers/IrController.cs @@ -16,9 +16,9 @@ namespace FBeeService.Controllers this._deviceService = deviceService; } - [HttpGet, Route("[action]"), SwaggerOperation("发送指令")] + [HttpGet, Route("/[controller]/[action]"), SwaggerOperation("发送指令")] - public ApiResponse PressKey([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number, [SwaggerParameter("按键类型")]byte type, [SwaggerParameter("键值")]ushort code) + public ApiResponse Send([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number, [SwaggerParameter("按键类型")]byte type, [SwaggerParameter("键值")]ushort code) { return this.AsyncAction(() => { diff --git a/projects/IoT/IoTServices/FBeeService/Infrastructure/DeviceService.cs b/projects/IoT/IoTServices/FBeeService/Infrastructure/DeviceService.cs index fb4615ce..bf7b7552 100644 --- a/projects/IoT/IoTServices/FBeeService/Infrastructure/DeviceService.cs +++ b/projects/IoT/IoTServices/FBeeService/Infrastructure/DeviceService.cs @@ -1231,6 +1231,7 @@ namespace FBeeService } } deviceRepo.SaveChanges(); + this.SendDevice(device); } } } diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/index.html b/projects/IoTClient/Assets/StreamingAssets/wwwroot/index.html index 14dc32be..9e62527b 100644 --- a/projects/IoTClient/Assets/StreamingAssets/wwwroot/index.html +++ b/projects/IoTClient/Assets/StreamingAssets/wwwroot/index.html @@ -569,19 +569,64 @@