IConnectorIot.csβ’1.56 kB
ο»Ώusing Api.DigitalPages.Interfaces.Models;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Api.DigitalPages.Interfaces.Connector
{
public interface IConnectorIot
{
Task<IIotDevice> DeviceFrom(string json, IIotDevice baseDevice = null);
Task<IIotDevice> Device(Guid uid, IotQueryOptions options);
Task<IPagedResult<IIotDevice>> Devices(IotQueryOptions options);
Task<IIotDevice> Create(IIotDevice device, IUser author);
Task<bool> Remove(IIotDevice device);
Task<IIotDevice> Update(IIotDevice device);
Task<IIotSamplingData<IIotDevice, IIotData>> Data(IIotDevice device, IotAggregationsOptions options = null);
Task<List<IIotSamplingData<IIotDevice, IIotData>>> Data(List<IIotDevice> devices, IotAggregationsOptions options = null);
}
public interface IIotSamplingData<TIotDevice, TIotData>
where TIotDevice : IIotDevice
where TIotData: IIotData
{
TIotDevice Device { get; set; }
List<TIotData> Datas { get; set; }
}
public interface IIotData
{
DateTime Timestamp { get; set; }
float Value { get; set; }
object CustomData { get; set; }
}
public class IotQueryOptions
{
public int Page { get; set; }
public int PageSize { get; set; }
public List<Guid> Entities { get; set; }
public bool IncludeEntities { get; set; }
public bool IncludeConfigurations { get; set; }
}
}