using Newtonsoft.Json;
using SqlSugar;
using System.ComponentModel;
namespace LY.App.Model
{
[SplitTable(SplitType.Month)]//按年分表 (自带分表支持 年、季、月、周、日)
[SugarTable("ly_alarm_{year}{month}{day}")]
public class Alarm : BaseEntity
{
///
/// 无人机批次id,
///
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName = "batch_id", ColumnDescription = "批次id")]
public long BatchId { get; set; }
///
/// #无人机的序列号
///
public string serial_number { get; set; }
///
/// #无人机型号
///
public string device_type { get; set; }
///
///
///
public int device_type_8 { get; set; }
///
/// #遥控器的纬
///
public double app_lat { get; set; }
public double app_lon { get; set; }
public double drone_lat { get; set; }
public double drone_lon { get; set; }
public double height { get; set; }
public double altitude { get; set; }
public double home_lat { get; set; }
public double home_lon { get; set; }
///
/// #距离飞手的距离
///
[SugarColumn(IsIgnore = true)]
public double distance { get; set; }
///
/// ,#东向速度
///
public double speed_E { get; set; }
///
/// #北向速度
///
public double speed_N { get; set; }
public double speed_U { get; set; }
///
/// #信号增益
///
[SugarColumn(ColumnName = "rssi", ColumnDescription = "信号增益")]
public double RSSI { get; set; }
///
/// 位置id
///
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName = "position_id", ColumnDescription = "阵地id")]
public long positionId { get; set; }
///
/// 位置id
///
[SugarColumn(ColumnName = "position_name", ColumnDescription = "阵地名字")]
public string PostionName { get; set; }
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName = "device_Id", ColumnDescription = "设备id")]
public long DeviceId { get; set; }
///
/// 来源设备名称
///
[SugarColumn(ColumnName = "device_name", ColumnDescription = "DeviceName")]
public string DeviceName { get; set; }
///
/// 频率
///
[SugarColumn(ColumnName = "freq", ColumnDescription = "频率")]
public double freq { get; set; }
public int alarmLevel { get; set; } = 1;
[SugarColumn(ColumnName = "time", ColumnDescription = "上传时间")]
public long Time { get; set; }
///
/// 创建时间
///
[SplitField]
[SugarColumn(IsNullable = true, ColumnDescription = "创建时间")]
public override DateTime CreateTime { get; set; } = DateTime.Now;
}
public class RevData
{
///
/// 设备序列号
///
public string product_ad_id { get; set; }
public IEnumerable data { get; set; }
///
/// time
///
public long time { get; set; }
public double product_lat { get; set; }
public double product_lon { get; set; }
public string product_id { get; set; }
}
///
/// 添加报警
///
public class AddAlarm
{
///
/// #无人机的序列号
///
public string serial_number { get; set; }
///
/// #无人机型号
///
public string device_type { get; set; }
///
///
///
public int device_type_8 { get; set; }
///
/// #遥控器的纬
///
public double app_lat { get; set; }
public double app_lon { get; set; }
public double drone_lat { get; set; }
public double drone_lon { get; set; }
public double height { get; set; }
public double altitude { get; set; }
public double home_lat { get; set; }
public double home_lon { get; set; }
public double freq { get; set; }
///
/// ,#东向速度
///
public double speed_E { get; set; }
///
/// #北向速度
///
public double speed_N { get; set; }
public double speed_U { get; set; }
///
/// #信号增益
///
public double RSSI { get; set; }
}
}