using JiShe.IoT.DeviceAggregation;
using JiShe.IoT.DeviceAggregation.Dto;
using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
namespace JiShe.IoT.Controllers
{
///
/// 设备聚合服务
///
[Route("/Aggregation/Device")]
public class DeviceAggregationController : IoTController
{
private readonly IDeviceAggregationService _deviceAggregationService;
public DeviceAggregationController(IDeviceAggregationService deviceAggregationService)
{
_deviceAggregationService = deviceAggregationService;
}
///
/// 创建设备信息
///
///
///
[HttpPost(nameof(CreateAsync))]
[SwaggerOperation(summary: "创建设备信息", Tags = new[] { "AggregationDevice" })]
public async Task CreateAsync(CreateDeviceAggregationInput input)
{
return await _deviceAggregationService.CreateAsync(input);
}
///
/// 删除设备信息
///
[HttpPost(nameof(DeleteAsync))]
[SwaggerOperation(summary: "删除设备信息", Tags = new[] { "AggregationDevice" })]
public async Task DeleteAsync(IdInput input)
{
return await _deviceAggregationService.DeleteAsync(input);
}
///
/// 根据设备ID查询设备信息
///
[HttpPost(nameof(FindByIdAsync))]
[SwaggerOperation(summary: "根据设备ID查询设备信息", Tags = new[] { "AggregationDevice" })]
public async Task FindByIdAsync(IdInput input)
{
return await _deviceAggregationService.FindByIdAsync(input);
}
}
}