using Application.Models; using IoTNode.DeviceServices.FBee; using Microsoft.AspNetCore.Mvc; using Swashbuckle.AspNetCore.Annotations; using System; namespace IoTNode.Controllers { public class DoorController : BaseDeviceController { private readonly FBeeService _deviceService; public DoorController(IServiceProvider applicationServices, FBeeService deviceService) : base(applicationServices) { this._deviceService = deviceService; } [HttpGet, Route("/[controller]/[action]"), SwaggerOperation("开")] public ApiResponse On([SwaggerParameter("设备编号")]string number) { return this.AsyncAction(() => { var values = number.Split('-'); this._deviceService.X82OpenDoor(values[0], values[1], 1); }); } } }