删除无用数据模型类
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace HTCoreServiceApp.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 采集运行日志
|
||||
/// </summary>
|
||||
public class HT_Service_Log
|
||||
{
|
||||
[Key]
|
||||
/// <summary>
|
||||
/// 编号
|
||||
/// </summary>
|
||||
public virtual int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public virtual DateTime EventTime { get; set; }
|
||||
/// <summary>
|
||||
/// 消息
|
||||
/// </summary>
|
||||
public virtual string? Message { get; set; }
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class LogAlarm
|
||||
{
|
||||
public DateTime StartTime { get; set; }
|
||||
|
||||
public string? Source { get; set; }
|
||||
|
||||
public int? ConditionId { get; set; }
|
||||
|
||||
public string? AlarmText { get; set; }
|
||||
|
||||
public object? AlarmValue { get; set; }
|
||||
|
||||
public int? Duration { get; set; }
|
||||
|
||||
public int? Severity { get; set; }
|
||||
|
||||
public int? SubAlarmType { get; set; }
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class LogEvent
|
||||
{
|
||||
public int? EventType { get; set; }
|
||||
|
||||
public int? Severity { get; set; }
|
||||
|
||||
public bool? IsAcked { get; set; }
|
||||
|
||||
public DateTime ActiveTime { get; set; }
|
||||
|
||||
public string? Source { get; set; }
|
||||
|
||||
public string? Comment { get; set; }
|
||||
|
||||
public int Sqlcounter { get; set; }
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class LogHdatum
|
||||
{
|
||||
public short Id { get; set; }
|
||||
|
||||
public DateTime TimeStamp { get; set; }
|
||||
|
||||
public float Value { get; set; }
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class Membership
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string UserName { get; set; } = null!;
|
||||
|
||||
public string Password { get; set; } = null!;
|
||||
|
||||
public short Role { get; set; }
|
||||
|
||||
public string? Email { get; set; }
|
||||
|
||||
public string? Phone { get; set; }
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class MetaCondition
|
||||
{
|
||||
public int TypeId { get; set; }
|
||||
|
||||
public string Source { get; set; } = null!;
|
||||
|
||||
public int AlarmType { get; set; }
|
||||
|
||||
public byte EventType { get; set; }
|
||||
|
||||
public byte ConditionType { get; set; }
|
||||
|
||||
public float Para { get; set; }
|
||||
|
||||
public bool? IsEnabled { get; set; }
|
||||
|
||||
public float DeadBand { get; set; }
|
||||
|
||||
public int Delay { get; set; }
|
||||
|
||||
public string? Comment { get; set; }
|
||||
|
||||
public virtual MetaSubCondition? MetaSubCondition { get; set; }
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class MetaScale
|
||||
{
|
||||
public short ScaleId { get; set; }
|
||||
|
||||
public byte ScaleType { get; set; }
|
||||
|
||||
public float? Euhi { get; set; }
|
||||
|
||||
public float? Eulo { get; set; }
|
||||
|
||||
public float? RawHi { get; set; }
|
||||
|
||||
public float? RawLo { get; set; }
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class MetaSubCondition
|
||||
{
|
||||
public int ConditionId { get; set; }
|
||||
|
||||
public int SubAlarmType { get; set; }
|
||||
|
||||
public float Threshold { get; set; }
|
||||
|
||||
public byte Severity { get; set; }
|
||||
|
||||
public string? Message { get; set; }
|
||||
|
||||
public bool? IsEnable { get; set; }
|
||||
|
||||
public virtual MetaCondition Condition { get; set; } = null!;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class RegisterModule
|
||||
{
|
||||
public int DriverId { get; set; }
|
||||
|
||||
public string? AssemblyName { get; set; }
|
||||
|
||||
public string? ClassName { get; set; }
|
||||
|
||||
public string? ClassFullName { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
}
|
@ -1,252 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace HTCoreServiceApp.Models;
|
||||
|
||||
public partial class ScadaContext : DbContext
|
||||
{
|
||||
private string ConnectionStrings;
|
||||
public ScadaContext(string connectionStrings)
|
||||
{
|
||||
ConnectionStrings = connectionStrings;
|
||||
}
|
||||
|
||||
[RequiresDynamicCode("Use 'MethodFriendlyToAot' instead")]
|
||||
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
|
||||
public ScadaContext(DbContextOptions<ScadaContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<Argument> Arguments { get; set; }
|
||||
|
||||
public virtual DbSet<HT_Service_Log> HT_Service_Log { get; set; }
|
||||
|
||||
public virtual DbSet<LogAlarm> LogAlarms { get; set; }
|
||||
|
||||
public virtual DbSet<LogEvent> LogEvents { get; set; }
|
||||
|
||||
public virtual DbSet<LogHdatum> LogHdata { get; set; }
|
||||
|
||||
public virtual DbSet<Membership> Memberships { get; set; }
|
||||
|
||||
public virtual DbSet<MetaCondition> MetaConditions { get; set; }
|
||||
|
||||
public virtual DbSet<MetaDriver> MetaDrivers { get; set; }
|
||||
|
||||
public virtual DbSet<MetaGroup> MetaGroups { get; set; }
|
||||
|
||||
public virtual DbSet<MetaScale> MetaScales { get; set; }
|
||||
|
||||
public virtual DbSet<MetaSubCondition> MetaSubConditions { get; set; }
|
||||
|
||||
public virtual DbSet<MetaTag> MetaTags { get; set; }
|
||||
|
||||
public virtual DbSet<RegisterModule> RegisterModules { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
|
||||
//=> optionsBuilder.UseSqlServer("Data Source=localhost\\SQLEXPRESS;Initial Catalog=SCADA;Integrated Security=True;Encrypt=True;TrustServerCertificate=True;");//localhost
|
||||
=> optionsBuilder.UseSqlServer(ConnectionStrings);//32
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Argument>(entity =>
|
||||
{
|
||||
entity.ToTable("Argument");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("ID");
|
||||
entity.Property(e => e.DriverId).HasColumnName("DriverID");
|
||||
entity.Property(e => e.PropertyName)
|
||||
.HasMaxLength(50)
|
||||
.IsUnicode(false);
|
||||
entity.Property(e => e.PropertyValue)
|
||||
.HasMaxLength(50)
|
||||
.IsUnicode(false);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<LogAlarm>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.StartTime);
|
||||
|
||||
entity.ToTable("Log_Alarm");
|
||||
|
||||
entity.Property(e => e.StartTime).HasColumnType("datetime");
|
||||
entity.Property(e => e.AlarmText).HasMaxLength(128);
|
||||
entity.Property(e => e.AlarmValue).HasColumnType("sql_variant");
|
||||
entity.Property(e => e.ConditionId).HasColumnName("ConditionID");
|
||||
entity.Property(e => e.Source).HasMaxLength(50);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<LogEvent>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ActiveTime);
|
||||
|
||||
entity.ToTable("Log_Event");
|
||||
|
||||
entity.Property(e => e.ActiveTime).HasColumnType("datetime");
|
||||
entity.Property(e => e.Comment).HasMaxLength(50);
|
||||
entity.Property(e => e.IsAcked).HasDefaultValueSql("((0))");
|
||||
entity.Property(e => e.Source).HasMaxLength(50);
|
||||
entity.Property(e => e.Sqlcounter)
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("SQLCounter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<LogHdatum>(entity =>
|
||||
{
|
||||
entity.ToTable("Log_HData");
|
||||
|
||||
entity.Property(e => e.Id)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("ID");
|
||||
entity.Property(e => e.TimeStamp).HasColumnType("datetime");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Membership>(entity =>
|
||||
{
|
||||
entity.ToTable("Membership");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("ID");
|
||||
entity.Property(e => e.Email)
|
||||
.HasMaxLength(50)
|
||||
.IsUnicode(false);
|
||||
entity.Property(e => e.Password).HasMaxLength(50);
|
||||
entity.Property(e => e.Phone)
|
||||
.HasMaxLength(50)
|
||||
.IsUnicode(false);
|
||||
entity.Property(e => e.UserName).HasMaxLength(50);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MetaCondition>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.TypeId);
|
||||
|
||||
entity.ToTable("Meta_Condition");
|
||||
|
||||
entity.Property(e => e.TypeId).HasColumnName("TypeID");
|
||||
entity.Property(e => e.Comment).HasMaxLength(50);
|
||||
entity.Property(e => e.IsEnabled)
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("((1))");
|
||||
entity.Property(e => e.Source).HasMaxLength(50);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MetaDriver>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.DriverId);
|
||||
|
||||
entity.ToTable("Meta_Driver");
|
||||
|
||||
entity.Property(e => e.DriverId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("DriverID");
|
||||
entity.Property(e => e.DriverName)
|
||||
.HasMaxLength(64)
|
||||
.HasDefaultValueSql("('')");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MetaGroup>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.GroupId);
|
||||
|
||||
entity.ToTable("Meta_Group");
|
||||
|
||||
entity.Property(e => e.GroupId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("GroupID");
|
||||
entity.Property(e => e.DriverId).HasColumnName("DriverID");
|
||||
entity.Property(e => e.GroupName).HasMaxLength(20);
|
||||
entity.Property(e => e.IsActive)
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("((1))");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MetaScale>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ScaleId);
|
||||
|
||||
entity.ToTable("Meta_Scale");
|
||||
|
||||
entity.Property(e => e.ScaleId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("ScaleID");
|
||||
entity.Property(e => e.Euhi).HasColumnName("EUHi");
|
||||
entity.Property(e => e.Eulo).HasColumnName("EULo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MetaSubCondition>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ConditionId);
|
||||
|
||||
entity.ToTable("Meta_SubCondition");
|
||||
|
||||
entity.Property(e => e.ConditionId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("ConditionID");
|
||||
entity.Property(e => e.IsEnable)
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("((1))");
|
||||
entity.Property(e => e.Message)
|
||||
.HasMaxLength(250)
|
||||
.HasDefaultValueSql("('')");
|
||||
|
||||
entity.HasOne(d => d.Condition).WithOne(p => p.MetaSubCondition)
|
||||
.HasForeignKey<MetaSubCondition>(d => d.ConditionId)
|
||||
.HasConstraintName("FK_Meta_SubCondition_Meta_Condition");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MetaTag>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.TagId);
|
||||
|
||||
entity.ToTable("Meta_Tag");
|
||||
|
||||
entity.Property(e => e.TagId).HasColumnName("TagID");
|
||||
entity.Property(e => e.Address)
|
||||
.HasMaxLength(64)
|
||||
.IsUnicode(false);
|
||||
entity.Property(e => e.DefaultValue).HasColumnType("sql_variant");
|
||||
entity.Property(e => e.Description).HasMaxLength(128);
|
||||
entity.Property(e => e.GroupId).HasColumnName("GroupID");
|
||||
entity.Property(e => e.IsActive)
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("((1))");
|
||||
entity.Property(e => e.TagName).HasMaxLength(512);
|
||||
entity.Property(e => e.Subsystem)
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasDefaultValueSql("('None')");
|
||||
entity.Property(e => e.Units)
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasDefaultValueSql("('N')");
|
||||
entity.Property(e => e.WriteAddress).HasMaxLength(64);
|
||||
entity.Property(e => e.SysType).HasMaxLength(32);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RegisterModule>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.DriverId);
|
||||
|
||||
entity.ToTable("RegisterModule");
|
||||
|
||||
entity.Property(e => e.DriverId).HasColumnName("DriverID");
|
||||
entity.Property(e => e.AssemblyName).HasMaxLength(255);
|
||||
entity.Property(e => e.ClassFullName)
|
||||
.HasMaxLength(128)
|
||||
.IsUnicode(false);
|
||||
entity.Property(e => e.ClassName)
|
||||
.HasMaxLength(50)
|
||||
.IsUnicode(false);
|
||||
entity.Property(e => e.Description).HasMaxLength(50);
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||
}
|
Reference in New Issue
Block a user