forked from ddrilling/AsbCloudServer
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using Microsoft.EntityFrameworkCore;
|
||
using System;
|
||
using System.ComponentModel.DataAnnotations.Schema;
|
||
|
||
namespace AsbCloudDb.Model.GTR
|
||
{
|
||
public class WitsItemBase<T> : ITelemetryData
|
||
where T: notnull
|
||
{
|
||
[Column("id_telemetry")]
|
||
public int IdTelemetry { get; set; }
|
||
|
||
[Column("id_record")]
|
||
public int IdRecord { get; set; }
|
||
|
||
[Column("id_item")]
|
||
public int IdItem { get; set; }
|
||
|
||
[Column("date", TypeName = "timestamp with time zone")]
|
||
public DateTimeOffset DateTime { get; set; }
|
||
|
||
[Column("value")]
|
||
public T Value { get; set; } = default!;
|
||
|
||
[ForeignKey(nameof(IdTelemetry))]
|
||
public virtual Telemetry? Telemetry { get; set; }
|
||
}
|
||
|
||
[Table("t_wits_string"), Comment("таблица данных ГТИ с типом значения string")]
|
||
public class WitsItemString : WitsItemBase<string> { }
|
||
|
||
[Table("t_wits_float"), Comment("таблица данных ГТИ с типом значения float")]
|
||
public class WitsItemFloat : WitsItemBase<float> { }
|
||
|
||
[Table("t_wits_int"), Comment("таблица данных ГТИ с типом значения int")]
|
||
public class WitsItemInt : WitsItemBase<int> { }
|
||
}
|