EFCore重新生成

如题
This commit is contained in:
tianshuanbao
2025-12-17 10:20:16 +08:00
parent 9deea4b3e9
commit 2a7b47cc58
17 changed files with 585 additions and 121 deletions

View File

@@ -20,4 +20,8 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.11" />
</ItemGroup>
<ItemGroup>
<Folder Include="PGModels\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class BlockIplog
{
public long Id { get; set; }
public string? Human { get; set; }
public DateTime? CreateTime { get; set; }
public string? BlockContent { get; set; }
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class BlsHotelsList
{
/// <summary>
/// ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 酒店编号
/// </summary>
public string? HotelCode { get; set; }
/// <summary>
/// 酒店名称
/// </summary>
public string? HotelName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateOnly? CreateDate { get; set; }
/// <summary>
/// 房间数
/// </summary>
public int? Rooms { get; set; }
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class DevMonitorlog
{
public long Id { get; set; }
public int? HotelId { get; set; }
public string? HotelCode { get; set; }
public string? HostNumber { get; set; }
public int? HostId { get; set; }
public string? RoomNo { get; set; }
public string? LanIp { get; set; }
public int? LanPort { get; set; }
public string? Mac { get; set; }
public int? WwwPort { get; set; }
public string? WwwIp { get; set; }
public string? CommandType { get; set; }
public string? SendOrReceive { get; set; }
public string? Data { get; set; }
public DateTime? CreateTime { get; set; }
public long? CreateTimeToUnixTime { get; set; }
public string? AnalysisData { get; set; }
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class Excelgenerater
{
public long Id { get; set; }
public string? StepInfo { get; set; }
public DateTime? CreateTime { get; set; }
public long? CreateTimeUnix { get; set; }
}

View File

@@ -0,0 +1,228 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace DAL.PGModels;
public partial class PostgresContext : DbContext
{
public PostgresContext()
{
}
public PostgresContext(DbContextOptions<PostgresContext> options)
: base(options)
{
}
public virtual DbSet<BlockIplog> BlockIplogs { get; set; }
public virtual DbSet<BlsHotelsList> BlsHotelsLists { get; set; }
public virtual DbSet<DevMonitorlog> DevMonitorlogs { get; set; }
public virtual DbSet<Excelgenerater> Excelgeneraters { get; set; }
public virtual DbSet<Qingao> Qingaos { get; set; }
public virtual DbSet<Recordhotel> Recordhotels { get; set; }
public virtual DbSet<SkyworthTvMonitorlog> SkyworthTvMonitorlogs { get; set; }
public virtual DbSet<StatisticsTotal> StatisticsTotals { get; set; }
public virtual DbSet<TclTvMonitorlog> TclTvMonitorlogs { get; set; }
public virtual DbSet<WebapiMonitorlog> WebapiMonitorlogs { 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 https://go.microsoft.com/fwlink/?LinkId=723263.
// => optionsBuilder.UseNpgsql("Server=10.8.8.208;Database=postgres;user id=postgres;password=blw#1234^_^;port=15432;");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<BlockIplog>(entity =>
{
entity.HasKey(e => e.Id).HasName("BlockIPLog_pkey");
entity.ToTable("BlockIPLog");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.CreateTime).HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.Human).HasMaxLength(255);
});
modelBuilder.Entity<BlsHotelsList>(entity =>
{
entity.HasKey(e => e.Id).HasName("BLS_Hotels_List_pkey");
entity.ToTable("BLS_Hotels_List");
entity.Property(e => e.Id)
.HasComment("ID")
.HasColumnName("ID");
entity.Property(e => e.CreateDate).HasComment("创建时间");
entity.Property(e => e.HotelCode)
.HasMaxLength(255)
.HasComment("酒店编号");
entity.Property(e => e.HotelName)
.HasMaxLength(255)
.HasComment("酒店名称");
entity.Property(e => e.Rooms).HasComment("房间数");
});
modelBuilder.Entity<DevMonitorlog>(entity =>
{
entity.HasKey(e => e.Id).HasName("dev_monitorlog_pkey");
entity.ToTable("dev_monitorlog");
entity.HasIndex(e => e.CommandType, "CommandType");
entity.HasIndex(e => e.CreateTimeToUnixTime, "CreateTime").IsDescending();
entity.HasIndex(e => e.Id, "ID").IsUnique();
entity.HasIndex(e => new { e.HotelCode, e.HostNumber, e.HostId, e.RoomNo }, "MAC");
entity.HasIndex(e => e.Mac, "MM");
entity.HasIndex(e => e.CreateTime, "T");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.CommandType).HasMaxLength(128);
entity.Property(e => e.CreateTime).HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.HostId).HasColumnName("HostID");
entity.Property(e => e.HostNumber).HasMaxLength(64);
entity.Property(e => e.HotelCode).HasMaxLength(64);
entity.Property(e => e.HotelId).HasColumnName("HotelID");
entity.Property(e => e.LanIp)
.HasMaxLength(64)
.HasColumnName("LanIP");
entity.Property(e => e.Mac)
.HasMaxLength(64)
.HasColumnName("MAC");
entity.Property(e => e.RoomNo).HasMaxLength(64);
entity.Property(e => e.SendOrReceive).HasMaxLength(64);
entity.Property(e => e.WwwIp)
.HasMaxLength(64)
.HasColumnName("WWW_IP");
entity.Property(e => e.WwwPort).HasColumnName("WWW_Port");
});
modelBuilder.Entity<Excelgenerater>(entity =>
{
entity.HasKey(e => e.Id).HasName("excelgenerater_pkey");
entity.ToTable("excelgenerater");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.CreateTime).HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.CreateTimeUnix).HasColumnName("CreateTime_UNIX");
});
modelBuilder.Entity<Qingao>(entity =>
{
entity.HasKey(e => e.Id).HasName("Qingao_pkey");
entity.ToTable("Qingao");
entity.Property(e => e.Id).HasIdentityOptions(null, null, null, null, true, null);
entity.Property(e => e.CurrentTime).HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.HotelCode).HasMaxLength(32);
entity.Property(e => e.RoomNumber).HasMaxLength(64);
entity.Property(e => e.TakeCardStatus).HasMaxLength(64);
});
modelBuilder.Entity<Recordhotel>(entity =>
{
entity.HasKey(e => e.Id).HasName("recordhotel_pkey");
entity.ToTable("recordhotel");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.CreateTime).HasMaxLength(64);
entity.Property(e => e.HotelId).HasColumnName("HotelID");
});
modelBuilder.Entity<SkyworthTvMonitorlog>(entity =>
{
entity.HasKey(e => e.Id).HasName("skyworth_tv_monitorlog_pkey");
entity.ToTable("skyworth_tv_monitorlog");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.HotelCode).HasMaxLength(64);
entity.Property(e => e.RequestId).HasMaxLength(64);
entity.Property(e => e.RequestTime).HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.ResponseTime).HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.RoomNum).HasMaxLength(64);
entity.Property(e => e.Step).HasMaxLength(16);
});
modelBuilder.Entity<StatisticsTotal>(entity =>
{
entity.HasKey(e => e.Id).HasName("statistics_total_pkey");
entity.ToTable("statistics_total");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.HostNumber).HasMaxLength(64);
entity.Property(e => e.HotelCode).HasMaxLength(64);
entity.Property(e => e.Mac)
.HasMaxLength(64)
.HasColumnName("MAC");
entity.Property(e => e.RxCount).HasColumnName("RX_Count");
entity.Property(e => e.TxCount).HasColumnName("TX_Count");
entity.Property(e => e.UpdateTime)
.HasMaxLength(64)
.HasColumnName("Update_Time");
});
modelBuilder.Entity<TclTvMonitorlog>(entity =>
{
entity.HasKey(e => e.Id).HasName("tcl_tv_monitorlog_pkey");
entity.ToTable("tcl_tv_monitorlog");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.HotelCode).HasMaxLength(64);
entity.Property(e => e.RequestId).HasMaxLength(64);
entity.Property(e => e.RequestTime).HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.ResponseTime).HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.RoomNumber).HasMaxLength(64);
entity.Property(e => e.Step)
.HasMaxLength(16)
.HasDefaultValueSql("NULL::character varying");
});
modelBuilder.Entity<WebapiMonitorlog>(entity =>
{
entity.HasKey(e => e.Id).HasName("webapi_monitorlog_pkey");
entity.ToTable("webapi_monitorlog");
entity.HasIndex(e => e.MethodName, "MethodName");
entity.HasIndex(e => new { e.InvokStartTime, e.InvokEndTime }, "Time");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.HotelCode).HasMaxLength(64);
entity.Property(e => e.InvokEndTime)
.HasMaxLength(64)
.HasColumnName("InvokEnd_Time");
entity.Property(e => e.InvokStartTime)
.HasMaxLength(64)
.HasColumnName("InvokStart_Time");
entity.Property(e => e.MethodName).HasMaxLength(128);
entity.Property(e => e.RemoteIp)
.HasMaxLength(64)
.HasColumnName("RemoteIP");
entity.Property(e => e.RoomNumber).HasMaxLength(64);
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

19
DAL/PGModels/Qingao.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class Qingao
{
public long Id { get; set; }
public string? RoomNumber { get; set; }
public string? HotelCode { get; set; }
public string? TakeCardStatus { get; set; }
public DateTime? CurrentTime { get; set; }
public bool? IsTriggerWelcomeMsg { get; set; }
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class Recordhotel
{
public int Id { get; set; }
public int? HotelId { get; set; }
public int? RoomNo { get; set; }
public string? CreateTime { get; set; }
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class SkyworthTvMonitorlog
{
public long Id { get; set; }
public DateTime? RequestTime { get; set; }
public string? Step { get; set; }
public string? HotelCode { get; set; }
public string? RoomNum { get; set; }
public string? RequestCommand { get; set; }
public string? RequestId { get; set; }
public string? ResponseMsg { get; set; }
public DateTime? ResponseTime { get; set; }
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class StatisticsTotal
{
public long Id { get; set; }
public string? HotelCode { get; set; }
public int? TxCount { get; set; }
public string? HostNumber { get; set; }
public string? Mac { get; set; }
public int? RxCount { get; set; }
public string? UpdateTime { get; set; }
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class TclTvMonitorlog
{
public long Id { get; set; }
public DateTime? RequestTime { get; set; }
public string? Step { get; set; }
public string? HotelCode { get; set; }
public string? RoomNumber { get; set; }
public string? RequestCommand { get; set; }
public string? RequestId { get; set; }
public string? ResponseMsg { get; set; }
public DateTime? ResponseTime { get; set; }
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
namespace DAL.PGModels;
public partial class WebapiMonitorlog
{
public long Id { get; set; }
public string? RemoteIp { get; set; }
public string? Parameters { get; set; }
public string? MethodName { get; set; }
public string? InvokStartTime { get; set; }
public string? InvokEndTime { get; set; }
public string? HotelCode { get; set; }
public string? RoomNumber { get; set; }
}