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.6 KiB
56 lines
1.6 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("[action]"), SwaggerOperation("查询所有网关")]
|
|
|
|
public ApiResponse Refresh()
|
|
{
|
|
return this.AsyncAction(() =>
|
|
{
|
|
this._deviceService.Execute();
|
|
});
|
|
}
|
|
|
|
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("查询网关信息")]
|
|
public ApiResponse X9d(string gateway)
|
|
{
|
|
return this.AsyncAction(() =>
|
|
{
|
|
this._deviceService.X9d(gateway);
|
|
});
|
|
}
|
|
|
|
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("查询所有设备")]
|
|
public ApiResponse X81(string gateway)
|
|
{
|
|
return this.AsyncAction(() =>
|
|
{
|
|
this._deviceService.X81(gateway);
|
|
});
|
|
}
|
|
|
|
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("删除指定设备")]
|
|
public ApiResponse X95(string gateway, string id)
|
|
{
|
|
return this.AsyncAction(() =>
|
|
{
|
|
this._deviceService.X95(gateway, id);
|
|
});
|
|
}
|
|
}
|
|
} |