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.
56 lines
1.8 KiB
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);
|
|
});
|
|
}
|
|
}
|
|
} |