2025-07-25 17:27:21 +08:00
|
|
|
|
using JiShe.IoT.DeviceAggregation;
|
2025-07-24 17:06:54 +08:00
|
|
|
|
using JiShe.IoT.DeviceAggregation.Dto;
|
|
|
|
|
|
using JiShe.ServicePro.Core;
|
2025-07-25 17:27:21 +08:00
|
|
|
|
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
|
2025-07-24 17:06:54 +08:00
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
{
|
2025-08-01 14:59:11 +08:00
|
|
|
|
return await _deviceAggregationService.CreateDeviceForApiAsync(input);
|
2025-07-24 17:06:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <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);
|
|
|
|
|
|
}
|
2025-07-29 17:30:52 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 重新推送设备信息到物联网平台
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("RepushDeviceInfoToIoTPlatform")]
|
|
|
|
|
|
[SwaggerOperation(summary: "重新推送设备信息到物联网平台", Tags = new[] { "AggregationDevice" })]
|
|
|
|
|
|
public Task<DeviceManagementInfoDto> RepushDeviceInfoToIoTPlatform(IdInput input)
|
|
|
|
|
|
{
|
|
|
|
|
|
return _deviceAggregationService.RepushDeviceInfoToIoTPlatform(input);
|
|
|
|
|
|
}
|
2025-07-24 17:06:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|