初始化
This commit is contained in:
41
BLW_Log/PGModels/DevMonitorlog.cs
Normal file
41
BLW_Log/PGModels/DevMonitorlog.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BLW_Log.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; }
|
||||
}
|
||||
15
BLW_Log/PGModels/Excelgenerater.cs
Normal file
15
BLW_Log/PGModels/Excelgenerater.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BLW_Log.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; }
|
||||
}
|
||||
27
BLW_Log/PGModels/IotMonitorlog.cs
Normal file
27
BLW_Log/PGModels/IotMonitorlog.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BLW_Log.PGModels;
|
||||
|
||||
public partial class IotMonitorlog
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public string? TriggerTime { get; set; }
|
||||
|
||||
public double? Step { get; set; }
|
||||
|
||||
public int? HotelId { get; set; }
|
||||
|
||||
public string? HotelName { get; set; }
|
||||
|
||||
public string? HotelCode { get; set; }
|
||||
|
||||
public string? RoomNumber { get; set; }
|
||||
|
||||
public string? CommandDescription { get; set; }
|
||||
|
||||
public string? Platform { get; set; }
|
||||
}
|
||||
169
BLW_Log/PGModels/PostgresContext.cs
Normal file
169
BLW_Log/PGModels/PostgresContext.cs
Normal file
@@ -0,0 +1,169 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BLW_Log.PGModels;
|
||||
|
||||
public partial class PostgresContext : DbContext
|
||||
{
|
||||
public PostgresContext()
|
||||
{
|
||||
}
|
||||
|
||||
public PostgresContext(DbContextOptions<PostgresContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<DevMonitorlog> DevMonitorlogs { get; set; }
|
||||
|
||||
public virtual DbSet<Excelgenerater> Excelgeneraters { get; set; }
|
||||
|
||||
public virtual DbSet<IotMonitorlog> IotMonitorlogs { get; set; }
|
||||
|
||||
public virtual DbSet<Recordhotel> Recordhotels { get; set; }
|
||||
|
||||
public virtual DbSet<StatisticsTotal> StatisticsTotals { get; set; }
|
||||
|
||||
public virtual DbSet<WebapiMonitorlog> WebapiMonitorlogs { get; set; }
|
||||
|
||||
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
//{
|
||||
// //if (!optionsBuilder.IsConfigured)
|
||||
// //{
|
||||
// // var configuration = new ConfigurationBuilder()
|
||||
// // .SetBasePath(Directory.GetCurrentDirectory())
|
||||
// // .AddJsonFile("appsettings.json")
|
||||
// // .Build();
|
||||
// // optionsBuilder.UseNpgsql(configuration.GetConnectionString("DefaultConnection"));
|
||||
// //}
|
||||
// //optionsBuilder.UseNpgsql("Server=10.8.8.212;Database=postgres;user id=postgres;password=123456;port=16035;");
|
||||
//}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
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 => 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)
|
||||
.UseIdentityAlwaysColumn()
|
||||
.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<IotMonitorlog>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("iot_monitorlog_pkey");
|
||||
|
||||
entity.ToTable("iot_monitorlog");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("ID");
|
||||
entity.Property(e => e.HotelCode).HasMaxLength(255);
|
||||
entity.Property(e => e.HotelName).HasMaxLength(255);
|
||||
entity.Property(e => e.Platform).HasMaxLength(128);
|
||||
entity.Property(e => e.RequestId).HasMaxLength(512);
|
||||
entity.Property(e => e.RoomNumber).HasMaxLength(255);
|
||||
entity.Property(e => e.TriggerTime).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<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<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);
|
||||
}
|
||||
15
BLW_Log/PGModels/Recordhotel.cs
Normal file
15
BLW_Log/PGModels/Recordhotel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BLW_Log.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; }
|
||||
}
|
||||
21
BLW_Log/PGModels/StatisticsTotal.cs
Normal file
21
BLW_Log/PGModels/StatisticsTotal.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BLW_Log.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; }
|
||||
}
|
||||
23
BLW_Log/PGModels/WebapiMonitorlog.cs
Normal file
23
BLW_Log/PGModels/WebapiMonitorlog.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BLW_Log.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; }
|
||||
}
|
||||
Reference in New Issue
Block a user