JiShe.IOT.Admin/src/JiShe.IoT.HttpApi/Controllers/DeviceAggregationController.cs

66 lines
2.2 KiB
C#
Raw Normal View History

using JiShe.IoT.CommonServices;
using JiShe.IoT.CommonServices.Dto;
using JiShe.IoT.DeviceAggregation;
using JiShe.IoT.DeviceAggregation.Dto;
using JiShe.IoT.OneNETAggregation;
using JiShe.IoT.OneNETAggregation.Dto;
using JiShe.ServicePro;
using JiShe.ServicePro.Commons;
using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.DeivceInfos.Dto;
using JiShe.ServicePro.DeviceManagement.Meters.Dto;
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Controllers
{
/// <summary>
/// 设备聚合服务
/// </summary>
[Route("/Aggregation/Device")]
public class DeviceAggregationController : IoTController
{
private readonly IDeviceAggregationService _deviceAggregationService;
public DeviceAggregationController(IDeviceAggregationService deviceAggregationService)
{
_deviceAggregationService = deviceAggregationService;
}
/// <summary>
/// 创建设备信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost(nameof(CreateAsync))]
[SwaggerOperation(summary: "创建设备信息", Tags = new[] { "AggregationDevice" })]
public async Task<bool> CreateAsync(CreateDeviceAggregationInput input)
{
return await _deviceAggregationService.CreateAsync(input);
}
/// <summary>
/// 删除设备信息
/// </summary>
[HttpPost(nameof(DeleteAsync))]
[SwaggerOperation(summary: "删除设备信息", Tags = new[] { "AggregationDevice" })]
public async Task<bool> DeleteAsync(IdInput input)
{
return await _deviceAggregationService.DeleteAsync(input);
}
/// <summary>
/// 根据设备ID查询设备信息
/// </summary>
[HttpPost(nameof(FindByIdAsync))]
[SwaggerOperation(summary: "根据设备ID查询设备信息", Tags = new[] { "AggregationDevice" })]
public async Task<DeviceManagementInfoDto> FindByIdAsync(IdInput input)
{
return await _deviceAggregationService.FindByIdAsync(input);
}
}
}