数据库添加注释和索引;数据库转移到data文件夹下方便docker挂载卷

This commit is contained in:
iioter 2024-07-19 09:23:04 +08:00
parent 601930fff3
commit 233c23cbb1
13 changed files with 2224 additions and 55 deletions

View File

@ -80,7 +80,7 @@ namespace IoTGateway.DataAccess
{ {
public DataContext CreateDbContext(string[] args) public DataContext CreateDbContext(string[] args)
{ {
return new DataContext("Data Source = ../IoTGateway/iotgateway.db", DBTypeEnum.SQLite); return new DataContext("Data Source = ../IoTGateway/data/iotgateway.db", DBTypeEnum.SQLite);
} }
} }

View File

@ -0,0 +1,951 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20240719011950_CommentAndIndex")]
partial class CommentAndIndex
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER")
.HasComment("启动");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER")
.HasComment("变化上传");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER")
.HasComment("指令间隔ms");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceName")
.HasColumnType("TEXT")
.HasComment("名称");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER")
.HasComment("类型(组或设备)");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT")
.HasComment("驱动");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER")
.HasComment("归档周期ms");
b.Property<uint>("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("AutoStart");
b.HasIndex("DeviceName");
b.HasIndex("DeviceTypeEnum");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
b.HasComment("设备维护");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER")
.HasComment("属性侧");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT")
.HasComment("名称");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT")
.HasComment("备注");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasComment("值");
b.HasKey("ID");
b.HasIndex("DeviceConfigName");
b.HasIndex("DeviceId");
b.HasIndex("Value");
b.ToTable("DeviceConfigs");
b.HasComment("通讯配置");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT")
.HasComment("别名");
b.Property<int>("DataType")
.HasColumnType("INTEGER")
.HasComment("数据类型");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT")
.HasComment("地址");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<int>("EndianType")
.HasColumnType("INTEGER")
.HasComment("大小端");
b.Property<string>("Expressions")
.HasColumnType("TEXT")
.HasComment("表达式");
b.Property<uint>("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<bool>("IsTrigger")
.HasColumnType("INTEGER")
.HasComment("触发");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER")
.HasComment("上传");
b.Property<string>("Method")
.HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasComment("变量名");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER")
.HasComment("权限");
b.HasKey("ID");
b.HasIndex("DataType");
b.HasIndex("DeviceAddress");
b.HasIndex("DeviceId");
b.HasIndex("Method");
b.HasIndex("Name");
b.ToTable("DeviceVariables");
b.HasComment("变量配置");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT")
.HasComment("程序集名");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER")
.HasComment("剩余授权数");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT")
.HasComment("驱动名");
b.Property<string>("FileName")
.HasColumnType("TEXT")
.HasComment("文件名");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
b.HasComment("驱动管理");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT")
.HasComment("结束时间");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER")
.HasComment("是否成功");
b.Property<string>("Method")
.HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Params")
.HasColumnType("TEXT")
.HasComment("请求参数");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER")
.HasComment("发起方");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT")
.HasComment("开始时间");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
b.HasComment("RPC日志");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT")
.HasComment("ClientId");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT")
.HasComment("网关名称");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER")
.HasComment("输出平台");
b.Property<string>("MqttIp")
.HasColumnType("TEXT")
.HasComment("Mqtt服务器");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER")
.HasComment("Mqtt端口");
b.Property<string>("MqttUName")
.HasColumnType("TEXT")
.HasComment("Mqtt用户名");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT")
.HasComment("Mqtt密码");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
b.HasComment("传输配置");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -24,13 +24,16 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<bool>("AutoStart") b.Property<bool>("AutoStart")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("启动");
b.Property<bool>("CgUpload") b.Property<bool>("CgUpload")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("变化上传");
b.Property<uint>("CmdPeriod") b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("指令间隔ms");
b.Property<string>("CreateBy") b.Property<string>("CreateBy")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
@ -39,22 +42,28 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Description") b.Property<string>("Description")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceName") b.Property<string>("DeviceName")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("名称");
b.Property<int>("DeviceTypeEnum") b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("类型(组或设备)");
b.Property<Guid?>("DriverId") b.Property<Guid?>("DriverId")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("驱动");
b.Property<uint>("EnforcePeriod") b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("归档周期ms");
b.Property<uint>("Index") b.Property<uint>("Index")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("排序");
b.Property<Guid?>("ParentId") b.Property<Guid?>("ParentId")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
@ -67,11 +76,19 @@ namespace IoTGateway.DataAccess.Migrations
b.HasKey("ID"); b.HasKey("ID");
b.HasIndex("AutoStart");
b.HasIndex("DeviceName");
b.HasIndex("DeviceTypeEnum");
b.HasIndex("DriverId"); b.HasIndex("DriverId");
b.HasIndex("ParentId"); b.HasIndex("ParentId");
b.ToTable("Devices"); b.ToTable("Devices");
b.HasComment("设备维护");
}); });
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b => modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
@ -88,19 +105,24 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<int>("DataSide") b.Property<int>("DataSide")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("属性侧");
b.Property<string>("Description") b.Property<string>("Description")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceConfigName") b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("名称");
b.Property<Guid?>("DeviceId") b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<string>("EnumInfo") b.Property<string>("EnumInfo")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("备注");
b.Property<string>("UpdateBy") b.Property<string>("UpdateBy")
.HasMaxLength(50) .HasMaxLength(50)
@ -110,13 +132,20 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Value") b.Property<string>("Value")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("值");
b.HasKey("ID"); b.HasKey("ID");
b.HasIndex("DeviceConfigName");
b.HasIndex("DeviceId"); b.HasIndex("DeviceId");
b.HasIndex("Value");
b.ToTable("DeviceConfigs"); b.ToTable("DeviceConfigs");
b.HasComment("通讯配置");
}); });
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b => modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
@ -126,49 +155,72 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Alias") b.Property<string>("Alias")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("别名");
b.Property<int>("DataType") b.Property<int>("DataType")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("数据类型");
b.Property<string>("Description") b.Property<string>("Description")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceAddress") b.Property<string>("DeviceAddress")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("地址");
b.Property<Guid?>("DeviceId") b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<int>("EndianType") b.Property<int>("EndianType")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("大小端");
b.Property<string>("Expressions") b.Property<string>("Expressions")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("表达式");
b.Property<uint>("Index") b.Property<uint>("Index")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("排序");
b.Property<bool>("IsTrigger") b.Property<bool>("IsTrigger")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("触发");
b.Property<bool>("IsUpload") b.Property<bool>("IsUpload")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("上传");
b.Property<string>("Method") b.Property<string>("Method")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Name") b.Property<string>("Name")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("变量名");
b.Property<int>("ProtectType") b.Property<int>("ProtectType")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("权限");
b.HasKey("ID"); b.HasKey("ID");
b.HasIndex("DataType");
b.HasIndex("DeviceAddress");
b.HasIndex("DeviceId"); b.HasIndex("DeviceId");
b.HasIndex("Method");
b.HasIndex("Name");
b.ToTable("DeviceVariables"); b.ToTable("DeviceVariables");
b.HasComment("变量配置");
}); });
modelBuilder.Entity("IoTGateway.Model.Driver", b => modelBuilder.Entity("IoTGateway.Model.Driver", b =>
@ -178,10 +230,12 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("AssembleName") b.Property<string>("AssembleName")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("程序集名");
b.Property<int>("AuthorizesNum") b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("剩余授权数");
b.Property<string>("CreateBy") b.Property<string>("CreateBy")
.HasMaxLength(50) .HasMaxLength(50)
@ -191,10 +245,12 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("DriverName") b.Property<string>("DriverName")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("驱动名");
b.Property<string>("FileName") b.Property<string>("FileName")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("文件名");
b.Property<string>("UpdateBy") b.Property<string>("UpdateBy")
.HasMaxLength(50) .HasMaxLength(50)
@ -206,6 +262,8 @@ namespace IoTGateway.DataAccess.Migrations
b.HasKey("ID"); b.HasKey("ID");
b.ToTable("Drivers"); b.ToTable("Drivers");
b.HasComment("驱动管理");
}); });
modelBuilder.Entity("IoTGateway.Model.RpcLog", b => modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
@ -215,34 +273,44 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Description") b.Property<string>("Description")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("描述");
b.Property<Guid?>("DeviceId") b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<DateTime>("EndTime") b.Property<DateTime>("EndTime")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("结束时间");
b.Property<bool>("IsSuccess") b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("是否成功");
b.Property<string>("Method") b.Property<string>("Method")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Params") b.Property<string>("Params")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("请求参数");
b.Property<int>("RpcSide") b.Property<int>("RpcSide")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("发起方");
b.Property<DateTime>("StartTime") b.Property<DateTime>("StartTime")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("开始时间");
b.HasKey("ID"); b.HasKey("ID");
b.HasIndex("DeviceId"); b.HasIndex("DeviceId");
b.ToTable("RpcLogs"); b.ToTable("RpcLogs");
b.HasComment("RPC日志");
}); });
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b => modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
@ -252,7 +320,8 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("ClientId") b.Property<string>("ClientId")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("ClientId");
b.Property<string>("CreateBy") b.Property<string>("CreateBy")
.HasMaxLength(50) .HasMaxLength(50)
@ -262,22 +331,28 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("GatewayName") b.Property<string>("GatewayName")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("网关名称");
b.Property<int>("IoTPlatformType") b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("输出平台");
b.Property<string>("MqttIp") b.Property<string>("MqttIp")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("Mqtt服务器");
b.Property<int>("MqttPort") b.Property<int>("MqttPort")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER")
.HasComment("Mqtt端口");
b.Property<string>("MqttUName") b.Property<string>("MqttUName")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("Mqtt用户名");
b.Property<string>("MqttUPwd") b.Property<string>("MqttUPwd")
.HasColumnType("TEXT"); .HasColumnType("TEXT")
.HasComment("Mqtt密码");
b.Property<string>("UpdateBy") b.Property<string>("UpdateBy")
.HasMaxLength(50) .HasMaxLength(50)
@ -289,6 +364,8 @@ namespace IoTGateway.DataAccess.Migrations
b.HasKey("ID"); b.HasKey("ID");
b.ToTable("SystemConfig"); b.ToTable("SystemConfig");
b.HasComment("传输配置");
}); });
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b => modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>

View File

@ -1,37 +1,52 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Runtime.CompilerServices;
using Microsoft.EntityFrameworkCore;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model namespace IoTGateway.Model
{ {
[Comment("设备维护")]
[Index(nameof(DeviceName))]
[Index(nameof(AutoStart))]
[Index(nameof(DeviceTypeEnum))]
public class Device : TreePoco<Device>, IBasePoco public class Device : TreePoco<Device>, IBasePoco
{ {
[Comment("名称")]
[Display(Name = "DeviceName")] [Display(Name = "DeviceName")]
public string DeviceName { get; set; } public string DeviceName { get; set; }
[Comment("排序")]
[Display(Name = "Sort")] [Display(Name = "Sort")]
public uint Index { get; set; } public uint Index { get; set; }
[Comment("描述")]
[Display(Name = "Description")] [Display(Name = "Description")]
public string Description { get; set; } public string Description { get; set; }
public Driver Driver { get; set; } public Driver Driver { get; set; }
[Comment("驱动")]
[Display(Name = "Driver")] [Display(Name = "Driver")]
public Guid? DriverId { get; set; } public Guid? DriverId { get; set; }
[Comment("启动")]
[Display(Name = "AutoStart")] [Display(Name = "AutoStart")]
public bool AutoStart { get; set; } public bool AutoStart { get; set; }
[Comment("变化上传")]
[Display(Name = "ChangeUpload")] [Display(Name = "ChangeUpload")]
public bool CgUpload { get; set; } public bool CgUpload { get; set; }
[Comment("归档周期ms")]
[Display(Name = "EnforcePeriodms")] [Display(Name = "EnforcePeriodms")]
public uint EnforcePeriod { get; set; } public uint EnforcePeriod { get; set; }
[Comment("指令间隔ms")]
[Display(Name = "CmdPeriodms")] [Display(Name = "CmdPeriodms")]
public uint CmdPeriod { get; set; } public uint CmdPeriod { get; set; }
[Comment("类型(组或设备)")]
[Display(Name = "Type")] [Display(Name = "Type")]
public DeviceTypeEnum DeviceTypeEnum { get; set; } public DeviceTypeEnum DeviceTypeEnum { get; set; }

View File

@ -1,22 +1,38 @@
using System; using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model namespace IoTGateway.Model
{ {
[Comment("通讯配置")]
[Index(nameof(DeviceConfigName))]
[Index(nameof(Value))]
public class DeviceConfig : BasePoco public class DeviceConfig : BasePoco
{ {
[Comment("名称")]
[Display(Name = "ConfigName")] [Display(Name = "ConfigName")]
public string DeviceConfigName { get; set; } public string DeviceConfigName { get; set; }
[Comment("属性侧")]
[Display(Name = "DataSide")] [Display(Name = "DataSide")]
public DataSide DataSide { get; set; } public DataSide DataSide { get; set; }
[Comment("描述")]
[Display(Name = "Description")] [Display(Name = "Description")]
public string Description { get; set; } public string Description { get; set; }
[Comment("值")]
[Display(Name = "Value")] [Display(Name = "Value")]
public string Value { get; set; } public string Value { get; set; }
[Comment("备注")]
[Display(Name = "Remark")] [Display(Name = "Remark")]
public string EnumInfo { get; set; } public string EnumInfo { get; set; }
public Device Device { get; set; } public Device Device { get; set; }
[Comment("所属设备")]
[Display(Name = "Device")] [Display(Name = "Device")]
public Guid? DeviceId { get; set; } public Guid? DeviceId { get; set; }
} }

View File

@ -5,70 +5,101 @@ using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
using Microsoft.EntityFrameworkCore;
namespace IoTGateway.Model namespace IoTGateway.Model
{ {
[Comment("变量配置")]
[Index(nameof(Name))]
[Index(nameof(Method))]
[Index(nameof(DeviceAddress))]
[Index(nameof(DataType))]
public class DeviceVariable : TopBasePoco, IVariable public class DeviceVariable : TopBasePoco, IVariable
{ {
[Comment("变量名")]
[Display(Name = "VariableName")] [Display(Name = "VariableName")]
public string Name { get; set; } public string Name { get; set; }
[Comment("描述")]
[Display(Name = "Description")] [Display(Name = "Description")]
public string Description { get; set; } public string Description { get; set; }
[Comment("方法")]
[Display(Name = "Method")] [Display(Name = "Method")]
public string Method { get; set; } public string Method { get; set; }
[Comment("地址")]
[Display(Name = "Address")] [Display(Name = "Address")]
public string DeviceAddress { get; set; } public string DeviceAddress { get; set; }
[Comment("数据类型")]
[Display(Name = "DataType")] [Display(Name = "DataType")]
public DataTypeEnum DataType { get; set; } public DataTypeEnum DataType { get; set; }
[Comment("触发")]
[Display(Name = "IsTrigger")] [Display(Name = "IsTrigger")]
public bool IsTrigger { get; set; } public bool IsTrigger { get; set; }
[Comment("大小端")]
[Display(Name = "EndianType")] [Display(Name = "EndianType")]
public EndianEnum EndianType { get; set; } public EndianEnum EndianType { get; set; }
[Comment("表达式")]
[Display(Name = "Expressions")] [Display(Name = "Expressions")]
public string Expressions { get; set; } public string Expressions { get; set; }
[Comment("上传")]
[Display(Name = "Upload")] [Display(Name = "Upload")]
public bool IsUpload { get; set; } public bool IsUpload { get; set; }
[Comment("权限")]
[Display(Name = "Permissions")] [Display(Name = "Permissions")]
public ProtectTypeEnum ProtectType { get; set; } public ProtectTypeEnum ProtectType { get; set; }
[Comment("排序")]
[Display(Name = "Sort")] [Display(Name = "Sort")]
public uint Index { get; set; } public uint Index { get; set; }
[Newtonsoft.Json.JsonIgnore] [Newtonsoft.Json.JsonIgnore]
public Device Device { get; set; } public Device Device { get; set; }
[Comment("所属设备")]
[Display(Name = "Device")] [Display(Name = "Device")]
public Guid? DeviceId { get; set; } public Guid? DeviceId { get; set; }
[Comment("别名")]
[Display(Name = "Alias")] [Display(Name = "Alias")]
public string Alias { get; set; } public string Alias { get; set; }
[Comment("原值")]
[NotMapped] [NotMapped]
[Display(Name = "RawValue")] [Display(Name = "RawValue")]
public object Value { get; set; } public object Value { get; set; }
[Comment("计算后的值")]
[NotMapped] [NotMapped]
[Display(Name = "CookedValue")] [Display(Name = "CookedValue")]
public object CookedValue { get; set; } public object CookedValue { get; set; }
[Comment("错误信息")]
[NotMapped] [NotMapped]
[Display(Name = "Message")] [Display(Name = "Message")]
public string Message { get; set; } public string Message { get; set; }
[Comment("更新时间")]
[NotMapped] [NotMapped]
[Display(Name = "Timestamp")] [Display(Name = "Timestamp")]
public DateTime Timestamp { get; set; } public DateTime Timestamp { get; set; }
[Comment("状态")]
[NotMapped] [NotMapped]
[Display(Name = "Status")] [Display(Name = "Status")]
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
public VaribaleStatusTypeEnum StatusType { get; set; } = VaribaleStatusTypeEnum.UnKnow; public VaribaleStatusTypeEnum StatusType { get; set; } = VaribaleStatusTypeEnum.UnKnow;
[Comment("最新三次原值")]
[NotMapped][Display(Name = "MostRecentValues")] public object[] Values { get; set; } = new object[3]; [NotMapped][Display(Name = "MostRecentValues")] public object[] Values { get; set; } = new object[3];
[Comment("最新三次计算后的值")]
[NotMapped][Display(Name = "MostRecentCookedValues")] public object[] CookedValues { get; set; } = new object[3]; [NotMapped][Display(Name = "MostRecentCookedValues")] public object[] CookedValues { get; set; } = new object[3];
public void EnqueueVariable(object value) public void EnqueueVariable(object value)
{ {

View File

@ -1,17 +1,26 @@
using System.Collections.Generic; using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model namespace IoTGateway.Model
{ {
[Comment("驱动管理")]
public class Driver : BasePoco public class Driver : BasePoco
{ {
[Comment("驱动名")]
[Display(Name = "DriverName")] [Display(Name = "DriverName")]
public string DriverName { get; set; } public string DriverName { get; set; }
[Comment("文件名")]
[Display(Name = "FileName")] [Display(Name = "FileName")]
public string FileName { get; set; } public string FileName { get; set; }
[Comment("程序集名")]
[Display(Name = "AssembleName")] [Display(Name = "AssembleName")]
public string AssembleName { get; set; } public string AssembleName { get; set; }
[Comment("剩余授权数")]
[Display(Name = "Remains")] [Display(Name = "Remains")]
public int AuthorizesNum { get; set; } public int AuthorizesNum { get; set; }
} }

View File

@ -1,4 +1,5 @@
using System; using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
@ -8,31 +9,40 @@ using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model namespace IoTGateway.Model
{ {
[Comment("RPC日志")]
public class RpcLog:TopBasePoco public class RpcLog:TopBasePoco
{ {
[Comment("发起方")]
[Display(Name = "RpcSide")] [Display(Name = "RpcSide")]
public RpcSide RpcSide { get; set; } public RpcSide RpcSide { get; set; }
[Comment("开始时间")]
[Display(Name = "StartTime")] [Display(Name = "StartTime")]
public DateTime StartTime { get; set; } public DateTime StartTime { get; set; }
public Device Device { get; set; } public Device Device { get; set; }
[Comment("所属设备")]
[Display(Name = "Device")] [Display(Name = "Device")]
public Guid? DeviceId { get; set; } public Guid? DeviceId { get; set; }
[Comment("方法")]
[Display(Name = "Method")] [Display(Name = "Method")]
public string Method { get; set; } public string Method { get; set; }
[Comment("请求参数")]
[Display(Name = "Parameters")] [Display(Name = "Parameters")]
public string Params { get; set; } public string Params { get; set; }
[Comment("结束时间")]
[Display(Name = "EndTime")] [Display(Name = "EndTime")]
public DateTime EndTime { get; set; } public DateTime EndTime { get; set; }
[Comment("是否成功")]
[Display(Name = "IsSuccess")] [Display(Name = "IsSuccess")]
public bool IsSuccess { get; set; } public bool IsSuccess { get; set; }
[Comment("描述")]
[Display(Name = "Description")] [Display(Name = "Description")]
public string Description { get; set; } public string Description { get; set; }
} }

View File

@ -1,22 +1,37 @@
using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model namespace IoTGateway.Model
{ {
[Comment("传输配置")]
public class SystemConfig : BasePoco public class SystemConfig : BasePoco
{ {
[Comment("网关名称")]
[Display(Name = "GatewayName")] [Display(Name = "GatewayName")]
public string GatewayName { get; set; } public string GatewayName { get; set; }
[Comment("ClientId")]
[Display(Name = "ClientId")] [Display(Name = "ClientId")]
public string ClientId { get; set; } public string ClientId { get; set; }
[Comment("Mqtt服务器")]
[Display(Name = "MqttServer ")] [Display(Name = "MqttServer ")]
public string MqttIp { get; set; } public string MqttIp { get; set; }
[Comment("Mqtt端口")]
[Display(Name = "MqttPort")] [Display(Name = "MqttPort")]
public int MqttPort { get; set; } public int MqttPort { get; set; }
[Comment("Mqtt用户名")]
[Display(Name = "UserName")] [Display(Name = "UserName")]
public string MqttUName { get; set; } public string MqttUName { get; set; }
[Comment("Mqtt密码")]
[Display(Name = "Password")] [Display(Name = "Password")]
public string MqttUPwd { get; set; } public string MqttUPwd { get; set; }
[Comment("输出平台")]
[Display(Name = "OutputPlatform")] [Display(Name = "OutputPlatform")]
public IoTPlatformType IoTPlatformType { get; set; } public IoTPlatformType IoTPlatformType { get; set; }
} }

View File

@ -33,7 +33,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="iotgateway.db"> <None Update="data\iotgateway.db">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Update="Quickstarts.ReferenceServer.Config.xml"> <None Update="Quickstarts.ReferenceServer.Config.xml">

View File

@ -29,7 +29,7 @@
"Connections": [ "Connections": [
{ {
"Key": "default", "Key": "default",
"Value": "Data Source = iotgateway.db", "Value": "Data Source = ./data/iotgateway.db",
"DbContext": "DataContext", "DbContext": "DataContext",
"DBType": "SQLite" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle "DBType": "SQLite" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
} }