using Application.Models; using IoT.Shared.Controllers; using Microsoft.AspNetCore.Mvc; using Swashbuckle.AspNetCore.Annotations; using System; namespace FBeeService.Controllers { [SwaggerTag("红外转发器")] public class IrController : BaseDeviceController { private readonly DeviceService _deviceService; public IrController(IServiceProvider applicationServices, DeviceService deviceService) : base(applicationServices) { this._deviceService = deviceService; } [HttpGet, Route("[action]"), SwaggerOperation("发送指令")] public ApiResponse PressKey([SwaggerParameter("网关Id")]string gateway, [SwaggerParameter("设备Id")]string id, [SwaggerParameter("按键类型")]byte type, [SwaggerParameter("键值")]ushort code) { return this.AsyncAction(() => { this._deviceService.XA70082(gateway, id, type, code); }); } [HttpGet, Route("/[controller]/[action]"), SwaggerOperation("学习")] public ApiResponse Study([SwaggerParameter("网关Id")]string gateway, [SwaggerParameter("设备Id")]string id, [SwaggerParameter("按键类型")]byte type, [SwaggerParameter("键值")]ushort code) { return this.AsyncAction(() => { this._deviceService.XA70083(gateway, id, type, code); }); } } }