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/GatewayController.cs

56 lines
1.8 KiB

using Application.Models;
using IoT.Shared.Controllers;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using System;
namespace FBeeService.Controllers
{
[SwaggerTag("网关")]
public class GatewayController : BaseDeviceController
{
private readonly DeviceService _deviceService;
public GatewayController(IServiceProvider applicationServices, DeviceService deviceService) : base(applicationServices)
{
this._deviceService = deviceService;
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse Refresh()
{
return this.AsyncAction(() =>
{
this._deviceService.Execute();
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse X9d([SwaggerParameter("网关Id")]string gateway)
{
return this.AsyncAction(() =>
{
this._deviceService.X9d(gateway);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse X81([SwaggerParameter("网关Id")]string gateway)
{
return this.AsyncAction(() =>
{
this._deviceService.X81(gateway);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse X95([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.X95(gateway, number);
});
}
}
}