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.
iot/projects/IoT/IoTServices/FBeeService/Controllers/IRController.cs

38 lines
1.4 KiB

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);
});
}
}
}