初始化

This commit is contained in:
2025-12-11 14:04:39 +08:00
commit 1f65bbf628
2676 changed files with 838983 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class DeviceAlertDatum
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 告警数据值(二进制格式)
/// </summary>
public byte[]? Value { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 客户端ID关联deviceinfo表
/// </summary>
public long? ClientId { get; set; }
/// <summary>
/// 设备端点地址
/// </summary>
public string? EndPoint { get; set; }
/// <summary>
/// 设备真实地址
/// </summary>
public string? RealAddress { get; set; }
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class DeviceFun
{
public int Id { get; set; }
public long? DeviceId { get; set; }
public string? FunctionName { get; set; }
public DateTime? CreateTime { get; set; }
public bool? IsDelete { get; set; }
}

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class DeviceRegisterDatum
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 重启原因
/// </summary>
public string? ReStartReason { get; set; }
/// <summary>
/// 设备分类ID
/// </summary>
public string? DeviceClassId { get; set; }
/// <summary>
/// 产品ID
/// </summary>
public string? Pid { get; set; }
/// <summary>
/// 机型ID
/// </summary>
public string? MachineTypeId { get; set; }
/// <summary>
/// MCU软件版本
/// </summary>
public string? McusoftVersion { get; set; }
/// <summary>
/// MCU硬件版本
/// </summary>
public string? McuhardVersion { get; set; }
/// <summary>
/// MCU唯一标识
/// </summary>
public string? Mcuuuid { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 客户端ID
/// </summary>
public long? ClientId { get; set; }
/// <summary>
/// 设备端点地址
/// </summary>
public string? EndPoint { get; set; }
/// <summary>
/// 设备真实地址
/// </summary>
public string? RealAddress { get; set; }
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class DeviceStatus
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 设备ID
/// </summary>
public long? DeviceId { get; set; }
/// <summary>
/// 设备端点地址
/// </summary>
public string? EndPoint { get; set; }
/// <summary>
/// 设备状态
/// </summary>
public string? Status { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 更新时间Unix时间戳
/// </summary>
public long? UpdateTimeUnix { get; set; }
}

View File

@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class Deviceinfo
{
/// <summary>
/// 客户端ID主键
/// </summary>
public long ClientId { get; set; }
/// <summary>
/// 机型类型
/// </summary>
public int? MachineType { get; set; }
/// <summary>
/// 设备唯一标识
/// </summary>
public string? Uuid { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string? OrderNo { get; set; }
/// <summary>
/// ProductID
/// </summary>
public int? ProductId { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public string? DeviceName { get; set; }
/// <summary>
/// 设备密钥
/// </summary>
public string? SecretKey { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 创建时间Unix时间戳
/// </summary>
public long? CreateTimeUnix { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 更新时间Unix时间戳
/// </summary>
public long? UpdateTimeUnix { get; set; }
/// <summary>
/// 酒店代码
/// </summary>
public int? HotelCode { get; set; }
/// <summary>
/// 备注信息
/// </summary>
public string? Remark { get; set; }
/// <summary>
/// Excel文件名
/// </summary>
public string? ExcelFileName { get; set; }
/// <summary>
/// Excel批次标记
/// </summary>
public long? ExcelBatchFlag { get; set; }
/// <summary>
/// 客户端状态0未使用1已分配2已激活3已注销
/// </summary>
public int? ClientStatus { get; set; }
/// <summary>
/// 是否删除标记
/// </summary>
public bool? IsDelete { get; set; }
/// <summary>
/// 厂牌ID
/// </summary>
public int? Brandld { get; set; }
/// <summary>
/// 设备UUID
/// </summary>
public string? McuUuid { get; set; }
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class EmqxLogininfo
{
/// <summary>
/// 主键ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string? UserName { get; set; }
/// <summary>
/// 密码
/// </summary>
public string? PassWord { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 创建时间Unix时间戳
/// </summary>
public long? CreateTimeUnix { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 更新时间Unix时间戳
/// </summary>
public long? UpdateTimeUnix { get; set; }
/// <summary>
/// 设备UUID
/// </summary>
public string? DeviceUuid { get; set; }
}

View File

@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class MachineType
{
/// <summary>
/// 主键ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 连接方式名称
/// </summary>
public string? ConnTypeName { get; set; }
/// <summary>
/// 设备类型名称
/// </summary>
public string? DeviceTypeName { get; set; }
/// <summary>
/// 设备信息描述
/// </summary>
public string? DeviceInfo { get; set; }
/// <summary>
/// 设备图片
/// </summary>
public string? Image { get; set; }
/// <summary>
/// 设备分类
/// </summary>
public string? DeviceClass { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 是否删除标记
/// </summary>
public bool? IsDelete { get; set; }
/// <summary>
/// 产品ID
/// </summary>
public int? ProductId { get; set; }
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class MachineTypeFun
{
/// <summary>
/// 主键ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 机型类型ID
/// </summary>
public long? MachineTypeId { get; set; }
/// <summary>
/// 功能名称
/// </summary>
public string? FunctionName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 是否删除标记
/// </summary>
public bool? IsDelete { get; set; }
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class MqttMonitorDatum
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// MQTT消息负载
/// </summary>
public string? Payload { get; set; }
/// <summary>
/// MQTT主题
/// </summary>
public string? Topic { get; set; }
/// <summary>
/// 创建时间Unix时间戳
/// </summary>
public long? Createtime { get; set; }
/// <summary>
/// 创建时间(日期时间格式)
/// </summary>
public DateTime? CreatetimeD { get; set; }
}

View File

@@ -0,0 +1,634 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace MySQLAccess.PGModels;
public partial class PostgresContext : DbContext
{
public PostgresContext()
{
}
public PostgresContext(DbContextOptions<PostgresContext> options)
: base(options)
{
}
public virtual DbSet<DeviceAlertDatum> DeviceAlertData { get; set; }
public virtual DbSet<DeviceRegisterDatum> DeviceRegisterData { get; set; }
public virtual DbSet<DeviceStatus> DeviceStatuses { get; set; }
public virtual DbSet<Deviceinfo> Deviceinfos { get; set; }
public virtual DbSet<EmqxLogininfo> EmqxLogininfos { get; set; }
public virtual DbSet<MachineType> MachineTypes { get; set; }
public virtual DbSet<MachineTypeFun> MachineTypeFuns { get; set; }
public virtual DbSet<MqttMonitorDatum> MqttMonitorData { get; set; }
public virtual DbSet<RoleFunMapping> RoleFunMappings { get; set; }
public virtual DbSet<Roleinfo> Roleinfos { get; set; }
public virtual DbSet<TcpCloseDatum> TcpCloseData { get; set; }
public virtual DbSet<TcpConnDatum> TcpConnData { get; set; }
public virtual DbSet<TcpHeartbeatDatum> TcpHeartbeatData { get; set; }
public virtual DbSet<TcpReceiveDatum> TcpReceiveData { get; set; }
public virtual DbSet<TcpSendDatum> TcpSendData { get; set; }
public virtual DbSet<TcpUserDevOperationLog> TcpUserDevOperationLogs { get; set; }
public virtual DbSet<Userinfo> Userinfos { 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=122.152.232.170;Database=postgres;user id=postgres;password=t3414T\"7wCU.&15]*QFu%_4CDhJI7g2b;port=65433;");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<DeviceAlertDatum>(entity =>
{
entity.HasKey(e => e.Id).HasName("device_alert_data_pkey");
entity.ToTable("device_alert_data");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.ClientId)
.HasComment("客户端ID关联deviceinfo表")
.HasColumnName("ClientID");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp without time zone");
entity.Property(e => e.EndPoint)
.HasMaxLength(64)
.HasComment("设备端点地址");
entity.Property(e => e.RealAddress)
.HasMaxLength(255)
.HasComment("设备真实地址");
entity.Property(e => e.Value).HasComment("告警数据值(二进制格式)");
});
modelBuilder.Entity<DeviceRegisterDatum>(entity =>
{
entity.HasKey(e => e.Id).HasName("device_register_data_pkey");
entity.ToTable("device_register_data");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.ClientId)
.HasComment("客户端ID")
.HasColumnName("ClientID");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp without time zone");
entity.Property(e => e.DeviceClassId)
.HasMaxLength(16)
.HasComment("设备分类ID")
.HasColumnName("DeviceClassID");
entity.Property(e => e.EndPoint)
.HasMaxLength(64)
.HasComment("设备端点地址");
entity.Property(e => e.MachineTypeId)
.HasMaxLength(32)
.HasComment("机型ID")
.HasColumnName("MachineTypeID");
entity.Property(e => e.McuhardVersion)
.HasMaxLength(16)
.HasComment("MCU硬件版本")
.HasColumnName("MCUHardVersion");
entity.Property(e => e.McusoftVersion)
.HasMaxLength(16)
.HasComment("MCU软件版本")
.HasColumnName("MCUSoftVersion");
entity.Property(e => e.Mcuuuid)
.HasMaxLength(64)
.HasComment("MCU唯一标识")
.HasColumnName("MCUUUID");
entity.Property(e => e.Pid)
.HasMaxLength(32)
.HasComment("产品ID")
.HasColumnName("PID");
entity.Property(e => e.ReStartReason)
.HasMaxLength(16)
.HasComment("重启原因");
entity.Property(e => e.RealAddress)
.HasMaxLength(255)
.HasComment("设备真实地址");
});
modelBuilder.Entity<DeviceStatus>(entity =>
{
entity.HasKey(e => e.Id).HasName("device_status_pkey");
entity.ToTable("device_status");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasIdentityOptions(null, null, null, null, true, null)
.HasColumnName("ID");
entity.Property(e => e.DeviceId)
.HasComment("设备ID")
.HasColumnName("DeviceID");
entity.Property(e => e.EndPoint)
.HasMaxLength(64)
.HasComment("设备端点地址");
entity.Property(e => e.Status)
.HasMaxLength(64)
.HasComment("设备状态");
entity.Property(e => e.UpdateTime)
.HasComment("更新时间")
.HasColumnType("timestamp without time zone");
entity.Property(e => e.UpdateTimeUnix)
.HasComment("更新时间Unix时间戳")
.HasColumnName("UpdateTime_Unix");
});
modelBuilder.Entity<Deviceinfo>(entity =>
{
entity.HasKey(e => e.ClientId).HasName("deviceinfo_pkey");
entity.ToTable("deviceinfo");
entity.Property(e => e.ClientId).HasComment("客户端ID主键");
entity.Property(e => e.Brandld).HasComment("厂牌ID");
entity.Property(e => e.ClientStatus).HasComment("客户端状态0未使用1已分配2已激活3已注销");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.CreateTimeUnix).HasComment("创建时间Unix时间戳");
entity.Property(e => e.DeviceName)
.HasMaxLength(255)
.HasComment("设备名称");
entity.Property(e => e.ExcelBatchFlag).HasComment("Excel批次标记");
entity.Property(e => e.ExcelFileName)
.HasMaxLength(255)
.HasComment("Excel文件名");
entity.Property(e => e.HotelCode).HasComment("酒店代码");
entity.Property(e => e.IsDelete)
.HasDefaultValue(false)
.HasComment("是否删除标记");
entity.Property(e => e.MachineType)
.HasComment("机型类型")
.HasColumnName("Machine_Type");
entity.Property(e => e.McuUuid)
.HasMaxLength(255)
.HasComment("设备UUID")
.HasColumnName("MCU_UUID");
entity.Property(e => e.OrderNo)
.HasMaxLength(255)
.HasComment("订单号");
entity.Property(e => e.ProductId).HasComment("ProductID");
entity.Property(e => e.Remark).HasComment("备注信息");
entity.Property(e => e.SecretKey)
.HasMaxLength(255)
.HasComment("设备密钥");
entity.Property(e => e.UpdateTime)
.HasComment("更新时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.UpdateTimeUnix).HasComment("更新时间Unix时间戳");
entity.Property(e => e.Uuid)
.HasMaxLength(64)
.HasComment("设备唯一标识")
.HasColumnName("UUID");
});
modelBuilder.Entity<EmqxLogininfo>(entity =>
{
entity.HasKey(e => e.Id).HasName("emqx_logininfo_pkey");
entity.ToTable("emqx_logininfo");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.CreateTimeUnix).HasComment("创建时间Unix时间戳");
entity.Property(e => e.DeviceUuid)
.HasMaxLength(64)
.HasComment("设备UUID")
.HasColumnName("DeviceUUID");
entity.Property(e => e.PassWord)
.HasMaxLength(255)
.HasComment("密码");
entity.Property(e => e.UpdateTime)
.HasComment("更新时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.UpdateTimeUnix).HasComment("更新时间Unix时间戳");
entity.Property(e => e.UserName)
.HasMaxLength(255)
.HasComment("用户名");
});
modelBuilder.Entity<MachineType>(entity =>
{
entity.HasKey(e => e.Id).HasName("machine_type_pkey");
entity.ToTable("machine_type");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.ConnTypeName)
.HasMaxLength(255)
.HasComment("连接方式名称");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.DeviceClass)
.HasMaxLength(255)
.HasComment("设备分类");
entity.Property(e => e.DeviceInfo).HasComment("设备信息描述");
entity.Property(e => e.DeviceTypeName)
.HasMaxLength(255)
.HasComment("设备类型名称");
entity.Property(e => e.Image).HasComment("设备图片");
entity.Property(e => e.IsDelete)
.HasDefaultValue(false)
.HasComment("是否删除标记");
entity.Property(e => e.ProductId).HasComment("产品ID");
entity.Property(e => e.UpdateTime)
.HasComment("更新时间")
.HasColumnType("timestamp(6) without time zone");
});
modelBuilder.Entity<MachineTypeFun>(entity =>
{
entity.HasKey(e => e.Id).HasName("device_fun_pkey");
entity.ToTable("machine_type_fun");
entity.Property(e => e.Id).HasComment("主键ID");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.FunctionName)
.HasMaxLength(255)
.HasComment("功能名称");
entity.Property(e => e.IsDelete)
.HasDefaultValue(false)
.HasComment("是否删除标记");
entity.Property(e => e.MachineTypeId).HasComment("机型类型ID");
});
modelBuilder.Entity<MqttMonitorDatum>(entity =>
{
entity.HasKey(e => e.Id).HasName("mqtt_monitor_data_pkey");
entity.ToTable("mqtt_monitor_data");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("id");
entity.Property(e => e.Createtime)
.HasComment("创建时间Unix时间戳")
.HasColumnName("createtime");
entity.Property(e => e.CreatetimeD)
.HasComment("创建时间(日期时间格式)")
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("createtime_d");
entity.Property(e => e.Payload)
.HasComment("MQTT消息负载")
.HasColumnName("payload");
entity.Property(e => e.Topic)
.HasMaxLength(255)
.HasComment("MQTT主题")
.HasColumnName("topic");
});
modelBuilder.Entity<RoleFunMapping>(entity =>
{
entity.HasKey(e => e.Id).HasName("role_fun_mapping_pkey");
entity.ToTable("role_fun_mapping");
entity.Property(e => e.Id).HasComment("主键ID");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.DeviceFunId).HasComment("设备功能ID");
entity.Property(e => e.IsDelete)
.HasDefaultValue(false)
.HasComment("是否删除标记");
entity.Property(e => e.RoleId).HasComment("角色ID");
});
modelBuilder.Entity<Roleinfo>(entity =>
{
entity.HasKey(e => e.Id).HasName("roleinfo_pkey");
entity.ToTable("roleinfo");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.DeviceLicense)
.HasMaxLength(255)
.HasComment("设备权限");
entity.Property(e => e.IsDelete)
.HasDefaultValue(false)
.HasComment("是否删除标记");
entity.Property(e => e.Permission)
.HasMaxLength(255)
.HasComment("页面权限");
entity.Property(e => e.Rolename)
.HasMaxLength(255)
.HasComment("角色名称");
entity.Property(e => e.UpdateTime)
.HasComment("更新时间")
.HasColumnType("timestamp(6) without time zone");
});
modelBuilder.Entity<TcpCloseDatum>(entity =>
{
entity.HasKey(e => e.Id).HasName("tcp_close_data_pkey");
entity.ToTable("tcp_close_data");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.ClientId)
.HasComment("客户端ID")
.HasColumnName("ClientID");
entity.Property(e => e.CloseReason)
.HasMaxLength(255)
.HasComment("关闭原因")
.HasColumnName("Close_Reason");
entity.Property(e => e.CreatetimeUnix)
.HasComment("创建时间Unix时间戳")
.HasColumnName("Createtime_Unix");
entity.Property(e => e.DataTakeOutTime)
.HasComment("数据提取时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.RealAddress)
.HasMaxLength(255)
.HasComment("真实地址");
entity.Property(e => e.WwwIp)
.HasMaxLength(255)
.HasComment("服务器IP地址")
.HasColumnName("WWW_IP");
entity.Property(e => e.WwwPort)
.HasComment("服务器端口")
.HasColumnName("WWW_Port");
});
modelBuilder.Entity<TcpConnDatum>(entity =>
{
entity.HasKey(e => e.Id).HasName("tcp_conn_data_pkey");
entity.ToTable("tcp_conn_data");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.ClientId)
.HasComment("客户端ID")
.HasColumnName("ClientID");
entity.Property(e => e.ConnectTime)
.HasComment("连接时间")
.HasColumnType("timestamp without time zone");
entity.Property(e => e.ConnectTimeUnix)
.HasComment("连接时间Unix时间戳")
.HasColumnName("ConnectTime_Unix");
entity.Property(e => e.RealAddress)
.HasMaxLength(255)
.HasComment("真实地址");
entity.Property(e => e.WwwIp)
.HasMaxLength(255)
.HasComment("服务器IP地址")
.HasColumnName("WWW_IP");
entity.Property(e => e.WwwPort)
.HasComment("服务器端口")
.HasColumnName("WWW_Port");
});
modelBuilder.Entity<TcpHeartbeatDatum>(entity =>
{
entity.HasKey(e => e.Id).HasName("tcp_heartbeat_data_pkey");
entity.ToTable("tcp_heartbeat_data");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.AdcOriginalValuue)
.HasMaxLength(32)
.HasComment("ADC原始值")
.HasColumnName("adc_original_valuue");
entity.Property(e => e.AnyHuman)
.HasMaxLength(255)
.HasComment("是否有人");
entity.Property(e => e.BgValue)
.HasMaxLength(255)
.HasComment("背景值")
.HasColumnName("Bg_Value");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.DeviceId)
.HasMaxLength(255)
.HasComment("设备ID");
entity.Property(e => e.DiffValue)
.HasMaxLength(255)
.HasComment("差值")
.HasColumnName("Diff_Value");
entity.Property(e => e.EnvValue)
.HasMaxLength(255)
.HasComment("环境值")
.HasColumnName("Env_Value");
entity.Property(e => e.ErrorCode)
.HasMaxLength(32)
.HasComment("错误代码")
.HasColumnName("error_code");
entity.Property(e => e.GuZhangCheck)
.HasMaxLength(255)
.HasComment("故障检查")
.HasColumnName("GuZhang_Check");
entity.Property(e => e.Humidity)
.HasMaxLength(255)
.HasComment("湿度");
entity.Property(e => e.McuT)
.HasMaxLength(255)
.HasComment("MCU温度")
.HasColumnName("MCU_T");
entity.Property(e => e.NongDuBaiFenBi)
.HasMaxLength(255)
.HasComment("浓度百分比")
.HasColumnName("NongDu_BaiFenBi");
entity.Property(e => e.OriginalDataId)
.HasComment("原始数据ID")
.HasColumnName("OriginalDataID");
entity.Property(e => e.RealTimeValue)
.HasMaxLength(255)
.HasComment("实时值")
.HasColumnName("RealTime_Value");
entity.Property(e => e.StableStatus)
.HasMaxLength(255)
.HasComment("稳定状态")
.HasColumnName("Stable_Status");
entity.Property(e => e.Temperature)
.HasMaxLength(255)
.HasComment("温度");
entity.Property(e => e.ThresholdValue1)
.HasMaxLength(255)
.HasComment("阈值1")
.HasColumnName("Threshold_Value1");
entity.Property(e => e.ThresholdValue2)
.HasMaxLength(255)
.HasComment("阈值2")
.HasColumnName("Threshold_Value2");
entity.Property(e => e.WorkStatus)
.HasMaxLength(255)
.HasComment("工作状态")
.HasColumnName("Work_Status");
});
modelBuilder.Entity<TcpReceiveDatum>(entity =>
{
entity.HasKey(e => e.Id).HasName("tcp_receive_data_pkey");
entity.ToTable("tcp_receive_data");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.ClientId)
.HasComment("客户端ID")
.HasColumnName("ClientID");
entity.Property(e => e.CommandType).HasComment("命令类型");
entity.Property(e => e.DencryptData).HasComment("解密后数据");
entity.Property(e => e.EndPoint)
.HasMaxLength(255)
.HasComment("端点地址");
entity.Property(e => e.InsertDate)
.HasComment("插入日期")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.InsertUnix).HasComment("插入时间Unix时间戳");
entity.Property(e => e.OriginalData).HasComment("原始数据");
});
modelBuilder.Entity<TcpSendDatum>(entity =>
{
entity.HasKey(e => e.Id).HasName("tcp_send_data_pkey");
entity.ToTable("tcp_send_data");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasIdentityOptions(null, null, null, null, true, null)
.HasColumnName("ID");
entity.Property(e => e.ClientId)
.HasComment("客户端ID")
.HasColumnName("ClientID");
entity.Property(e => e.CommandType)
.HasMaxLength(16)
.HasComment("命令类型");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp without time zone");
entity.Property(e => e.CreateTimeUnix)
.HasComment("创建时间Unix时间戳")
.HasColumnName("CreateTime_Unix");
entity.Property(e => e.SendData).HasComment("发送数据");
});
modelBuilder.Entity<TcpUserDevOperationLog>(entity =>
{
entity.HasKey(e => e.Id).HasName("tcp_user_dev_operation_log_pkey");
entity.ToTable("tcp_user_dev_operation_log");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasIdentityOptions(null, null, null, null, true, null)
.HasColumnName("ID");
entity.Property(e => e.Action).HasComment("操作动作");
entity.Property(e => e.ClientId)
.HasComment("客户端ID")
.HasColumnName("ClientID");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp without time zone");
entity.Property(e => e.Remark).HasComment("备注信息");
entity.Property(e => e.UserId)
.HasComment("用户ID")
.HasColumnName("User_ID");
entity.Property(e => e.UserIp)
.HasMaxLength(255)
.HasComment("用户IP地址")
.HasColumnName("User_IP");
entity.Property(e => e.UserLocation)
.HasMaxLength(255)
.HasComment("用户位置")
.HasColumnName("User_Location");
entity.Property(e => e.UserSystem)
.HasMaxLength(255)
.HasComment("用户系统信息")
.HasColumnName("User_System");
});
modelBuilder.Entity<Userinfo>(entity =>
{
entity.HasKey(e => e.Id).HasName("userinfo_pkey");
entity.ToTable("userinfo");
entity.Property(e => e.Id)
.HasComment("主键ID")
.HasColumnName("ID");
entity.Property(e => e.CompanyName)
.HasMaxLength(255)
.HasComment("公司名称");
entity.Property(e => e.CreateTime)
.HasComment("创建时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.IsDelete)
.HasDefaultValue(false)
.HasComment("是否删除标记");
entity.Property(e => e.Mobile)
.HasMaxLength(255)
.HasComment("手机号码");
entity.Property(e => e.PassWord)
.HasMaxLength(255)
.HasComment("密码");
entity.Property(e => e.Permission)
.HasMaxLength(255)
.HasComment("权限信息");
entity.Property(e => e.PswEncryption)
.HasMaxLength(255)
.HasComment("密码加密密钥");
entity.Property(e => e.RealName)
.HasMaxLength(255)
.HasComment("真实姓名");
entity.Property(e => e.RoleId).HasComment("角色ID");
entity.Property(e => e.UpdateTime)
.HasComment("更新时间")
.HasColumnType("timestamp(6) without time zone");
entity.Property(e => e.UserName)
.HasMaxLength(255)
.HasComment("用户名");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class RoleFunMapping
{
/// <summary>
/// 主键ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 角色ID
/// </summary>
public int? RoleId { get; set; }
/// <summary>
/// 设备功能ID
/// </summary>
public int? DeviceFunId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 是否删除标记
/// </summary>
public bool? IsDelete { get; set; }
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class Roleinfo
{
/// <summary>
/// 主键ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 角色名称
/// </summary>
public string? Rolename { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 页面权限
/// </summary>
public string? Permission { get; set; }
/// <summary>
/// 是否删除标记
/// </summary>
public bool? IsDelete { get; set; }
/// <summary>
/// 设备权限
/// </summary>
public string? DeviceLicense { get; set; }
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class TcpCloseDatum
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 服务器IP地址
/// </summary>
public string? WwwIp { get; set; }
/// <summary>
/// 服务器端口
/// </summary>
public int? WwwPort { get; set; }
/// <summary>
/// 关闭原因
/// </summary>
public string? CloseReason { get; set; }
/// <summary>
/// 数据提取时间
/// </summary>
public DateTime? DataTakeOutTime { get; set; }
/// <summary>
/// 创建时间Unix时间戳
/// </summary>
public long? CreatetimeUnix { get; set; }
/// <summary>
/// 客户端ID
/// </summary>
public long? ClientId { get; set; }
/// <summary>
/// 真实地址
/// </summary>
public string? RealAddress { get; set; }
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class TcpConnDatum
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 服务器IP地址
/// </summary>
public string? WwwIp { get; set; }
/// <summary>
/// 服务器端口
/// </summary>
public int? WwwPort { get; set; }
/// <summary>
/// 客户端ID
/// </summary>
public int? ClientId { get; set; }
/// <summary>
/// 连接时间
/// </summary>
public DateTime? ConnectTime { get; set; }
/// <summary>
/// 连接时间Unix时间戳
/// </summary>
public long? ConnectTimeUnix { get; set; }
/// <summary>
/// 真实地址
/// </summary>
public string? RealAddress { get; set; }
}

View File

@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class TcpHeartbeatDatum
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 工作状态
/// </summary>
public string? WorkStatus { get; set; }
/// <summary>
/// 实时值
/// </summary>
public string? RealTimeValue { get; set; }
/// <summary>
/// 环境值
/// </summary>
public string? EnvValue { get; set; }
/// <summary>
/// 背景值
/// </summary>
public string? BgValue { get; set; }
/// <summary>
/// 差值
/// </summary>
public string? DiffValue { get; set; }
/// <summary>
/// 浓度百分比
/// </summary>
public string? NongDuBaiFenBi { get; set; }
/// <summary>
/// 稳定状态
/// </summary>
public string? StableStatus { get; set; }
/// <summary>
/// 阈值1
/// </summary>
public string? ThresholdValue1 { get; set; }
/// <summary>
/// 阈值2
/// </summary>
public string? ThresholdValue2 { get; set; }
/// <summary>
/// MCU温度
/// </summary>
public string? McuT { get; set; }
/// <summary>
/// 故障检查
/// </summary>
public string? GuZhangCheck { get; set; }
/// <summary>
/// 温度
/// </summary>
public string? Temperature { get; set; }
/// <summary>
/// 湿度
/// </summary>
public string? Humidity { get; set; }
/// <summary>
/// 是否有人
/// </summary>
public string? AnyHuman { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 原始数据ID
/// </summary>
public long? OriginalDataId { get; set; }
/// <summary>
/// 设备ID
/// </summary>
public string? DeviceId { get; set; }
/// <summary>
/// ADC原始值
/// </summary>
public string? AdcOriginalValuue { get; set; }
/// <summary>
/// 错误代码
/// </summary>
public string? ErrorCode { get; set; }
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class TcpReceiveDatum
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 原始数据
/// </summary>
public string? OriginalData { get; set; }
/// <summary>
/// 解密后数据
/// </summary>
public string? DencryptData { get; set; }
/// <summary>
/// 插入日期
/// </summary>
public DateTime? InsertDate { get; set; }
/// <summary>
/// 插入时间Unix时间戳
/// </summary>
public long? InsertUnix { get; set; }
/// <summary>
/// 端点地址
/// </summary>
public string? EndPoint { get; set; }
/// <summary>
/// 客户端ID
/// </summary>
public long? ClientId { get; set; }
/// <summary>
/// 命令类型
/// </summary>
public short? CommandType { get; set; }
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class TcpSendDatum
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 发送数据
/// </summary>
public string? SendData { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 创建时间Unix时间戳
/// </summary>
public long? CreateTimeUnix { get; set; }
/// <summary>
/// 客户端ID
/// </summary>
public int? ClientId { get; set; }
/// <summary>
/// 命令类型
/// </summary>
public string? CommandType { get; set; }
}

View File

@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class TcpUserDevOperationLog
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 客户端ID
/// </summary>
public long? ClientId { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public int? UserId { get; set; }
/// <summary>
/// 用户IP地址
/// </summary>
public string? UserIp { get; set; }
/// <summary>
/// 用户系统信息
/// </summary>
public string? UserSystem { get; set; }
/// <summary>
/// 用户位置
/// </summary>
public string? UserLocation { get; set; }
/// <summary>
/// 操作动作
/// </summary>
public string? Action { get; set; }
/// <summary>
/// 备注信息
/// </summary>
public string? Remark { get; set; }
}

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
namespace MySQLAccess.PGModels;
public partial class Userinfo
{
/// <summary>
/// 主键ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string? UserName { get; set; }
/// <summary>
/// 密码加密密钥
/// </summary>
public string? PswEncryption { get; set; }
/// <summary>
/// 密码
/// </summary>
public string? PassWord { get; set; }
/// <summary>
/// 公司名称
/// </summary>
public string? CompanyName { get; set; }
/// <summary>
/// 真实姓名
/// </summary>
public string? RealName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 手机号码
/// </summary>
public string? Mobile { get; set; }
/// <summary>
/// 权限信息
/// </summary>
public string? Permission { get; set; }
/// <summary>
/// 是否删除标记
/// </summary>
public bool? IsDelete { get; set; }
/// <summary>
/// 角色ID
/// </summary>
public int? RoleId { get; set; }
}