From 24045c6aaf55a515122c62165822c2d2069a0b03 Mon Sep 17 00:00:00 2001 From: wq1234wq Date: Wed, 3 Nov 2021 19:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E5=88=99=E6=8E=A5=E5=85=A5=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0211103094103_addrulemounttype.Designer.cs | 1511 +++++++++++++++++ .../20211103094103_addrulemounttype.cs | 24 + ...1103101343_modifyrulemounttype.Designer.cs | 1511 +++++++++++++++++ .../20211103101343_modifyrulemounttype.cs | 17 + .../ApplicationDbContextModelSnapshot.cs | 3 + IoTSharp.Data/Enums.cs | 9 + IoTSharp.Data/FlowRule.cs | 2 + IoTSharp.TaskAction/ITaskAction.cs | 4 +- IoTSharp.TaskAction/MessagePullExcutor.cs | 2 +- .../layout/basic/widgets/notify.component.ts | 184 +- .../layout/basic/widgets/task.component.ts | 4 +- .../devicelist/devicelist.component.html | 96 +- .../device/devicelist/devicelist.component.ts | 136 +- .../flow/flowform/flowform.component.html | 8 + .../flow/flowform/flowform.component.ts | 2 + .../flow/flowlist/flowlist.component.html | 2 +- .../flow/flowlist/flowlist.component.ts | 38 +- .../ClientApp/src/app/routes/routes.module.ts | 3 +- IoTSharp/Controllers/DevicesController.cs | 19 + IoTSharp/Controllers/RulesController.cs | 4 + IoTSharp/IoTSharp.csproj | 1 + 21 files changed, 3367 insertions(+), 213 deletions(-) create mode 100644 IoTSharp.Data.PostgreSQL/Migrations/20211103094103_addrulemounttype.Designer.cs create mode 100644 IoTSharp.Data.PostgreSQL/Migrations/20211103094103_addrulemounttype.cs create mode 100644 IoTSharp.Data.PostgreSQL/Migrations/20211103101343_modifyrulemounttype.Designer.cs create mode 100644 IoTSharp.Data.PostgreSQL/Migrations/20211103101343_modifyrulemounttype.cs diff --git a/IoTSharp.Data.PostgreSQL/Migrations/20211103094103_addrulemounttype.Designer.cs b/IoTSharp.Data.PostgreSQL/Migrations/20211103094103_addrulemounttype.Designer.cs new file mode 100644 index 00000000..722f396c --- /dev/null +++ b/IoTSharp.Data.PostgreSQL/Migrations/20211103094103_addrulemounttype.Designer.cs @@ -0,0 +1,1511 @@ +// +using System; +using IoTSharp.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +namespace IoTSharp.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20211103094103_addrulemounttype")] + partial class addrulemounttype + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 63) + .HasAnnotation("ProductVersion", "5.0.11") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + modelBuilder.Entity("IoTSharp.Data.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ActionData") + .HasColumnType("jsonb"); + + b.Property("ActionName") + .HasColumnType("text"); + + b.Property("ActionResult") + .HasColumnType("jsonb"); + + b.Property("ActiveDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("ObjectID") + .HasColumnType("uuid"); + + b.Property("ObjectName") + .HasColumnType("text"); + + b.Property("ObjectType") + .HasColumnType("integer"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("UserName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("TenantId"); + + b.ToTable("AuditLog"); + }); + + modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuthToken") + .HasColumnType("text"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("TenantId"); + + b.ToTable("AuthorizedKeys"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseDictionary", b => + { + b.Property("DictionaryId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Dictionary18NKeyName") + .HasColumnType("text"); + + b.Property("DictionaryColor") + .HasColumnType("text"); + + b.Property("DictionaryDesc") + .HasColumnType("text"); + + b.Property("DictionaryGroupId") + .HasColumnType("bigint"); + + b.Property("DictionaryIcon") + .HasColumnType("text"); + + b.Property("DictionaryName") + .HasColumnType("text"); + + b.Property("DictionaryPattern") + .HasColumnType("text"); + + b.Property("DictionaryStatus") + .HasColumnType("integer"); + + b.Property("DictionaryTag") + .HasColumnType("text"); + + b.Property("DictionaryValue") + .HasColumnType("text"); + + b.Property("DictionaryValueType") + .HasColumnType("integer"); + + b.Property("DictionaryValueTypeName") + .HasColumnType("text"); + + b.HasKey("DictionaryId"); + + b.ToTable("BaseDictionaries"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseDictionaryGroup", b => + { + b.Property("DictionaryGroupId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("DictionaryGroup18NKeyName") + .HasColumnType("text"); + + b.Property("DictionaryGroupDesc") + .HasColumnType("text"); + + b.Property("DictionaryGroupKey") + .HasColumnType("text"); + + b.Property("DictionaryGroupName") + .HasColumnType("text"); + + b.Property("DictionaryGroupStatus") + .HasColumnType("integer"); + + b.Property("DictionaryGroupValueType") + .HasColumnType("integer"); + + b.Property("DictionaryGroupValueTypeName") + .HasColumnType("text"); + + b.HasKey("DictionaryGroupId"); + + b.ToTable("BaseDictionaryGroups"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseEvent", b => + { + b.Property("EventId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BizData") + .HasColumnType("text"); + + b.Property("Bizid") + .HasColumnType("text"); + + b.Property("CreaterDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("EventDesc") + .HasColumnType("text"); + + b.Property("EventName") + .HasColumnType("text"); + + b.Property("EventStaus") + .HasColumnType("integer"); + + b.Property("FlowRuleRuleId") + .HasColumnType("uuid"); + + b.Property("MataData") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("EventId"); + + b.HasIndex("FlowRuleRuleId"); + + b.ToTable("BaseEvents"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseI18N", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AddDate") + .HasColumnType("timestamp without time zone"); + + b.Property("KeyName") + .HasColumnType("text"); + + b.Property("ResouceDesc") + .HasColumnType("text"); + + b.Property("ResouceGroupId") + .HasColumnType("integer"); + + b.Property("ResourceId") + .HasColumnType("bigint"); + + b.Property("ResourceKey") + .HasColumnType("text"); + + b.Property("ResourceTag") + .HasColumnType("text"); + + b.Property("ResourceType") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("ValueBG") + .HasColumnType("text"); + + b.Property("ValueCS") + .HasColumnType("text"); + + b.Property("ValueDA") + .HasColumnType("text"); + + b.Property("ValueDEDE") + .HasColumnType("text"); + + b.Property("ValueELGR") + .HasColumnType("text"); + + b.Property("ValueENGR") + .HasColumnType("text"); + + b.Property("ValueENUS") + .HasColumnType("text"); + + b.Property("ValueESES") + .HasColumnType("text"); + + b.Property("ValueFI") + .HasColumnType("text"); + + b.Property("ValueFRFR") + .HasColumnType("text"); + + b.Property("ValueHE") + .HasColumnType("text"); + + b.Property("ValueHRHR") + .HasColumnType("text"); + + b.Property("ValueHU") + .HasColumnType("text"); + + b.Property("ValueITIT") + .HasColumnType("text"); + + b.Property("ValueJAJP") + .HasColumnType("text"); + + b.Property("ValueKOKR") + .HasColumnType("text"); + + b.Property("ValueNL") + .HasColumnType("text"); + + b.Property("ValuePLPL") + .HasColumnType("text"); + + b.Property("ValuePT") + .HasColumnType("text"); + + b.Property("ValueSLSL") + .HasColumnType("text"); + + b.Property("ValueSR") + .HasColumnType("text"); + + b.Property("ValueSV") + .HasColumnType("text"); + + b.Property("ValueTRTR") + .HasColumnType("text"); + + b.Property("ValueUK") + .HasColumnType("text"); + + b.Property("ValueVI") + .HasColumnType("text"); + + b.Property("ValueZHCN") + .HasColumnType("text"); + + b.Property("ValueZHTW") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("BaseI18Ns"); + }); + + modelBuilder.Entity("IoTSharp.Data.Customer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Address") + .HasColumnType("text"); + + b.Property("City") + .HasColumnType("text"); + + b.Property("Country") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Phone") + .HasColumnType("text"); + + b.Property("Province") + .HasColumnType("text"); + + b.Property("Street") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("ZipCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("Customer"); + }); + + modelBuilder.Entity("IoTSharp.Data.DataStorage", b => + { + b.Property("Catalog") + .HasColumnType("integer"); + + b.Property("DeviceId") + .HasColumnType("uuid"); + + b.Property("KeyName") + .HasColumnType("text"); + + b.Property("DataSide") + .HasColumnType("integer"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Value_Binary") + .HasColumnType("bytea"); + + b.Property("Value_Boolean") + .HasColumnType("boolean"); + + b.Property("Value_DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Value_Double") + .HasColumnType("double precision"); + + b.Property("Value_Json") + .HasColumnType("jsonb"); + + b.Property("Value_Long") + .HasColumnType("bigint"); + + b.Property("Value_String") + .HasColumnType("text"); + + b.Property("Value_XML") + .HasColumnType("xml"); + + b.HasKey("Catalog", "DeviceId", "KeyName"); + + b.HasIndex("Catalog"); + + b.HasIndex("Catalog", "DeviceId"); + + b.ToTable("DataStorage"); + + b.HasDiscriminator("Catalog").HasValue(0); + }); + + modelBuilder.Entity("IoTSharp.Data.Device", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuthorizedKeyId") + .HasColumnType("uuid"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("DeviceType") + .HasColumnType("integer"); + + b.Property("LastActive") + .HasColumnType("timestamp without time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Online") + .HasColumnType("boolean"); + + b.Property("OwnerId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Timeout") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizedKeyId"); + + b.HasIndex("CustomerId"); + + b.HasIndex("OwnerId"); + + b.HasIndex("TenantId"); + + b.ToTable("Device"); + + b.HasDiscriminator("DeviceType").HasValue(0); + }); + + modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DeviceId") + .HasColumnType("uuid"); + + b.Property("IdentityId") + .IsRequired() + .HasColumnType("text"); + + b.Property("IdentityType") + .HasColumnType("integer"); + + b.Property("IdentityValue") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("DeviceId"); + + b.ToTable("DeviceIdentities"); + }); + + modelBuilder.Entity("IoTSharp.Data.DeviceRule", b => + { + b.Property("DeviceRuleId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConfigDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ConfigUser") + .HasColumnType("uuid"); + + b.Property("DeviceId") + .HasColumnType("uuid"); + + b.Property("FlowRuleRuleId") + .HasColumnType("uuid"); + + b.HasKey("DeviceRuleId"); + + b.HasIndex("DeviceId"); + + b.HasIndex("FlowRuleRuleId"); + + b.ToTable("DeviceRules"); + }); + + modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldInfo", b => + { + b.Property("FieldId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("FieldCode") + .HasColumnType("text"); + + b.Property("FieldCreateDate") + .HasColumnType("timestamp without time zone"); + + b.Property("FieldEditDate") + .HasColumnType("timestamp without time zone"); + + b.Property("FieldI18nKey") + .HasColumnType("text"); + + b.Property("FieldMaxLength") + .HasColumnType("integer"); + + b.Property("FieldName") + .HasColumnType("text"); + + b.Property("FieldPattern") + .HasColumnType("text"); + + b.Property("FieldPocoTypeName") + .HasColumnType("text"); + + b.Property("FieldStatus") + .HasColumnType("integer"); + + b.Property("FieldUIElement") + .HasColumnType("bigint"); + + b.Property("FieldUIElementSchema") + .HasColumnType("text"); + + b.Property("FieldUnit") + .HasColumnType("text"); + + b.Property("FieldValue") + .HasColumnType("text"); + + b.Property("FieldValueDataSource") + .HasColumnType("text"); + + b.Property("FieldValueLocalDataSource") + .HasColumnType("text"); + + b.Property("FieldValueType") + .HasColumnType("integer"); + + b.Property("FieldValueTypeName") + .HasColumnType("text"); + + b.Property("FormId") + .HasColumnType("bigint"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("IsRequired") + .HasColumnType("boolean"); + + b.HasKey("FieldId"); + + b.ToTable("DynamicFormFieldInfos"); + }); + + modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldValueInfo", b => + { + b.Property("FieldValueId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("BizId") + .HasColumnType("bigint"); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("FieldCode") + .HasColumnType("text"); + + b.Property("FieldCreateDate") + .HasColumnType("timestamp without time zone"); + + b.Property("FieldId") + .HasColumnType("bigint"); + + b.Property("FieldName") + .HasColumnType("text"); + + b.Property("FieldUnit") + .HasColumnType("text"); + + b.Property("FieldValue") + .HasColumnType("text"); + + b.Property("FieldValueType") + .HasColumnType("bigint"); + + b.Property("FromId") + .HasColumnType("bigint"); + + b.HasKey("FieldValueId"); + + b.ToTable("DynamicFormFieldValueInfos"); + }); + + modelBuilder.Entity("IoTSharp.Data.DynamicFormInfo", b => + { + b.Property("FormId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("BizId") + .HasColumnType("bigint"); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("FormCreator") + .HasColumnType("bigint"); + + b.Property("FormDesc") + .HasColumnType("text"); + + b.Property("FormLayout") + .HasColumnType("text"); + + b.Property("FormName") + .HasColumnType("text"); + + b.Property("FormSchame") + .HasColumnType("text"); + + b.Property("FormStatus") + .HasColumnType("integer"); + + b.Property("FromCreateDate") + .HasColumnType("timestamp without time zone"); + + b.Property("IsCompact") + .HasColumnType("boolean"); + + b.Property("ModelClass") + .HasColumnType("text"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("FormId"); + + b.ToTable("DynamicFormInfos"); + }); + + modelBuilder.Entity("IoTSharp.Data.Flow", b => + { + b.Property("FlowId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Conditionexpression") + .HasColumnType("text"); + + b.Property("CreateDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreateId") + .HasColumnType("uuid"); + + b.Property("Createor") + .HasColumnType("uuid"); + + b.Property("ExecutorId") + .HasColumnType("uuid"); + + b.Property("FlowRuleRuleId") + .HasColumnType("uuid"); + + b.Property("FlowStatus") + .HasColumnType("integer"); + + b.Property("FlowType") + .HasColumnType("text"); + + b.Property("Flowdesc") + .HasColumnType("text"); + + b.Property("Flowname") + .HasColumnType("text"); + + b.Property("Incoming") + .HasColumnType("text"); + + b.Property("NodeProcessClass") + .HasColumnType("text"); + + b.Property("NodeProcessMethod") + .HasColumnType("text"); + + b.Property("NodeProcessParams") + .HasColumnType("text"); + + b.Property("NodeProcessScript") + .HasColumnType("text"); + + b.Property("NodeProcessScriptType") + .HasColumnType("text"); + + b.Property("NodeProcessType") + .HasColumnType("text"); + + b.Property("ObjectId") + .HasColumnType("text"); + + b.Property("Outgoing") + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("text"); + + b.Property("TargetId") + .HasColumnType("text"); + + b.Property("TestStatus") + .HasColumnType("integer"); + + b.Property("Tester") + .HasColumnType("uuid"); + + b.Property("TesterDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("bpmnid") + .HasColumnType("text"); + + b.HasKey("FlowId"); + + b.HasIndex("ExecutorId"); + + b.HasIndex("FlowRuleRuleId"); + + b.ToTable("Flows"); + }); + + modelBuilder.Entity("IoTSharp.Data.FlowOperation", b => + { + b.Property("OperationId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AddDate") + .HasColumnType("timestamp without time zone"); + + b.Property("BaseEventEventId") + .HasColumnType("uuid"); + + b.Property("BizId") + .HasColumnType("text"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("FlowId") + .HasColumnType("uuid"); + + b.Property("FlowRuleRuleId") + .HasColumnType("uuid"); + + b.Property("NodeStatus") + .HasColumnType("integer"); + + b.Property("OperationDesc") + .HasColumnType("text"); + + b.Property("Step") + .HasColumnType("integer"); + + b.Property("Tag") + .HasColumnType("text"); + + b.Property("bpmnid") + .HasColumnType("text"); + + b.HasKey("OperationId"); + + b.HasIndex("BaseEventEventId"); + + b.HasIndex("FlowId"); + + b.HasIndex("FlowRuleRuleId"); + + b.ToTable("FlowOperations"); + }); + + modelBuilder.Entity("IoTSharp.Data.FlowRule", b => + { + b.Property("RuleId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Creator") + .HasColumnType("text"); + + b.Property("DefinitionsXml") + .HasColumnType("text"); + + b.Property("Describes") + .HasColumnType("text"); + + b.Property("ExecutableCode") + .HasColumnType("text"); + + b.Property("MountType") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentRuleId") + .HasColumnType("uuid"); + + b.Property("RuleDesc") + .HasColumnType("text"); + + b.Property("RuleStatus") + .HasColumnType("integer"); + + b.Property("RuleType") + .HasColumnType("integer"); + + b.Property("Runner") + .HasColumnType("text"); + + b.Property("SubVersion") + .HasColumnType("double precision"); + + b.HasKey("RuleId"); + + b.ToTable("FlowRules"); + }); + + modelBuilder.Entity("IoTSharp.Data.Relationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("IdentityUserId") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("IdentityUserId"); + + b.HasIndex("TenantId"); + + b.ToTable("Relationship"); + }); + + modelBuilder.Entity("IoTSharp.Data.RuleTaskExecutor", b => + { + b.Property("ExecutorId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AddDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("DefaultConfig") + .HasColumnType("text"); + + b.Property("ExecutorDesc") + .HasColumnType("text"); + + b.Property("ExecutorName") + .HasColumnType("text"); + + b.Property("ExecutorStatus") + .HasColumnType("integer"); + + b.Property("MataData") + .HasColumnType("text"); + + b.Property("Path") + .HasColumnType("text"); + + b.Property("Tag") + .HasColumnType("text"); + + b.Property("TestStatus") + .HasColumnType("integer"); + + b.Property("Tester") + .HasColumnType("uuid"); + + b.Property("TesterDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TypeName") + .HasColumnType("text"); + + b.HasKey("ExecutorId"); + + b.ToTable("RuleTaskExecutors"); + }); + + modelBuilder.Entity("IoTSharp.Data.TelemetryData", b => + { + b.Property("DeviceId") + .HasColumnType("uuid"); + + b.Property("KeyName") + .HasColumnType("text"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DataSide") + .HasColumnType("integer"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Value_Binary") + .HasColumnType("bytea"); + + b.Property("Value_Boolean") + .HasColumnType("boolean"); + + b.Property("Value_DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Value_Double") + .HasColumnType("double precision"); + + b.Property("Value_Json") + .HasColumnType("jsonb"); + + b.Property("Value_Long") + .HasColumnType("bigint"); + + b.Property("Value_String") + .HasColumnType("text"); + + b.Property("Value_XML") + .HasColumnType("xml"); + + b.HasKey("DeviceId", "KeyName", "DateTime"); + + b.HasIndex("DeviceId"); + + b.HasIndex("KeyName"); + + b.HasIndex("DeviceId", "KeyName"); + + b.ToTable("TelemetryData"); + }); + + modelBuilder.Entity("IoTSharp.Data.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Address") + .HasColumnType("text"); + + b.Property("City") + .HasColumnType("text"); + + b.Property("Country") + .HasColumnType("text"); + + b.Property("EMail") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Phone") + .HasColumnType("text"); + + b.Property("Province") + .HasColumnType("text"); + + b.Property("Street") + .HasColumnType("text"); + + b.Property("ZipCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Tenant"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b => + { + b.HasBaseType("IoTSharp.Data.DataStorage"); + + b.HasDiscriminator().HasValue(2); + }); + + modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b => + { + b.HasBaseType("IoTSharp.Data.DataStorage"); + + b.HasDiscriminator().HasValue(4); + }); + + modelBuilder.Entity("IoTSharp.Data.Gateway", b => + { + b.HasBaseType("IoTSharp.Data.Device"); + + b.HasDiscriminator().HasValue(1); + }); + + modelBuilder.Entity("IoTSharp.Data.AuditLog", b => + { + b.HasOne("IoTSharp.Data.Customer", "Customer") + .WithMany() + .HasForeignKey("CustomerId"); + + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId"); + + b.Navigation("Customer"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b => + { + b.HasOne("IoTSharp.Data.Customer", "Customer") + .WithMany() + .HasForeignKey("CustomerId"); + + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId"); + + b.Navigation("Customer"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseEvent", b => + { + b.HasOne("IoTSharp.Data.FlowRule", "FlowRule") + .WithMany() + .HasForeignKey("FlowRuleRuleId"); + + b.Navigation("FlowRule"); + }); + + modelBuilder.Entity("IoTSharp.Data.Customer", b => + { + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany("Customers") + .HasForeignKey("TenantId"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("IoTSharp.Data.Device", b => + { + b.HasOne("IoTSharp.Data.AuthorizedKey", null) + .WithMany("Devices") + .HasForeignKey("AuthorizedKeyId"); + + b.HasOne("IoTSharp.Data.Customer", "Customer") + .WithMany("Devices") + .HasForeignKey("CustomerId"); + + b.HasOne("IoTSharp.Data.Gateway", "Owner") + .WithMany("Children") + .HasForeignKey("OwnerId"); + + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany("Devices") + .HasForeignKey("TenantId"); + + b.Navigation("Customer"); + + b.Navigation("Owner"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b => + { + b.HasOne("IoTSharp.Data.Device", "Device") + .WithMany() + .HasForeignKey("DeviceId"); + + b.Navigation("Device"); + }); + + modelBuilder.Entity("IoTSharp.Data.DeviceRule", b => + { + b.HasOne("IoTSharp.Data.Device", "Device") + .WithMany() + .HasForeignKey("DeviceId"); + + b.HasOne("IoTSharp.Data.FlowRule", "FlowRule") + .WithMany() + .HasForeignKey("FlowRuleRuleId"); + + b.Navigation("Device"); + + b.Navigation("FlowRule"); + }); + + modelBuilder.Entity("IoTSharp.Data.Flow", b => + { + b.HasOne("IoTSharp.Data.RuleTaskExecutor", "Executor") + .WithMany() + .HasForeignKey("ExecutorId"); + + b.HasOne("IoTSharp.Data.FlowRule", "FlowRule") + .WithMany() + .HasForeignKey("FlowRuleRuleId"); + + b.Navigation("Executor"); + + b.Navigation("FlowRule"); + }); + + modelBuilder.Entity("IoTSharp.Data.FlowOperation", b => + { + b.HasOne("IoTSharp.Data.BaseEvent", "BaseEvent") + .WithMany() + .HasForeignKey("BaseEventEventId"); + + b.HasOne("IoTSharp.Data.Flow", "Flow") + .WithMany() + .HasForeignKey("FlowId"); + + b.HasOne("IoTSharp.Data.FlowRule", "FlowRule") + .WithMany() + .HasForeignKey("FlowRuleRuleId"); + + b.Navigation("BaseEvent"); + + b.Navigation("Flow"); + + b.Navigation("FlowRule"); + }); + + modelBuilder.Entity("IoTSharp.Data.Relationship", b => + { + b.HasOne("IoTSharp.Data.Customer", "Customer") + .WithMany() + .HasForeignKey("CustomerId"); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "IdentityUser") + .WithMany() + .HasForeignKey("IdentityUserId"); + + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId"); + + b.Navigation("Customer"); + + b.Navigation("IdentityUser"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b => + { + b.Navigation("Devices"); + }); + + modelBuilder.Entity("IoTSharp.Data.Customer", b => + { + b.Navigation("Devices"); + }); + + modelBuilder.Entity("IoTSharp.Data.Tenant", b => + { + b.Navigation("Customers"); + + b.Navigation("Devices"); + }); + + modelBuilder.Entity("IoTSharp.Data.Gateway", b => + { + b.Navigation("Children"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/IoTSharp.Data.PostgreSQL/Migrations/20211103094103_addrulemounttype.cs b/IoTSharp.Data.PostgreSQL/Migrations/20211103094103_addrulemounttype.cs new file mode 100644 index 00000000..8c7dd0ba --- /dev/null +++ b/IoTSharp.Data.PostgreSQL/Migrations/20211103094103_addrulemounttype.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace IoTSharp.Migrations +{ + public partial class addrulemounttype : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "MountType", + table: "FlowRules", + type: "integer", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "MountType", + table: "FlowRules"); + } + } +} diff --git a/IoTSharp.Data.PostgreSQL/Migrations/20211103101343_modifyrulemounttype.Designer.cs b/IoTSharp.Data.PostgreSQL/Migrations/20211103101343_modifyrulemounttype.Designer.cs new file mode 100644 index 00000000..8cd1c1d2 --- /dev/null +++ b/IoTSharp.Data.PostgreSQL/Migrations/20211103101343_modifyrulemounttype.Designer.cs @@ -0,0 +1,1511 @@ +// +using System; +using IoTSharp.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +namespace IoTSharp.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20211103101343_modifyrulemounttype")] + partial class modifyrulemounttype + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 63) + .HasAnnotation("ProductVersion", "5.0.11") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + modelBuilder.Entity("IoTSharp.Data.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ActionData") + .HasColumnType("jsonb"); + + b.Property("ActionName") + .HasColumnType("text"); + + b.Property("ActionResult") + .HasColumnType("jsonb"); + + b.Property("ActiveDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("ObjectID") + .HasColumnType("uuid"); + + b.Property("ObjectName") + .HasColumnType("text"); + + b.Property("ObjectType") + .HasColumnType("integer"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("UserName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("TenantId"); + + b.ToTable("AuditLog"); + }); + + modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuthToken") + .HasColumnType("text"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("TenantId"); + + b.ToTable("AuthorizedKeys"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseDictionary", b => + { + b.Property("DictionaryId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Dictionary18NKeyName") + .HasColumnType("text"); + + b.Property("DictionaryColor") + .HasColumnType("text"); + + b.Property("DictionaryDesc") + .HasColumnType("text"); + + b.Property("DictionaryGroupId") + .HasColumnType("bigint"); + + b.Property("DictionaryIcon") + .HasColumnType("text"); + + b.Property("DictionaryName") + .HasColumnType("text"); + + b.Property("DictionaryPattern") + .HasColumnType("text"); + + b.Property("DictionaryStatus") + .HasColumnType("integer"); + + b.Property("DictionaryTag") + .HasColumnType("text"); + + b.Property("DictionaryValue") + .HasColumnType("text"); + + b.Property("DictionaryValueType") + .HasColumnType("integer"); + + b.Property("DictionaryValueTypeName") + .HasColumnType("text"); + + b.HasKey("DictionaryId"); + + b.ToTable("BaseDictionaries"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseDictionaryGroup", b => + { + b.Property("DictionaryGroupId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("DictionaryGroup18NKeyName") + .HasColumnType("text"); + + b.Property("DictionaryGroupDesc") + .HasColumnType("text"); + + b.Property("DictionaryGroupKey") + .HasColumnType("text"); + + b.Property("DictionaryGroupName") + .HasColumnType("text"); + + b.Property("DictionaryGroupStatus") + .HasColumnType("integer"); + + b.Property("DictionaryGroupValueType") + .HasColumnType("integer"); + + b.Property("DictionaryGroupValueTypeName") + .HasColumnType("text"); + + b.HasKey("DictionaryGroupId"); + + b.ToTable("BaseDictionaryGroups"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseEvent", b => + { + b.Property("EventId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BizData") + .HasColumnType("text"); + + b.Property("Bizid") + .HasColumnType("text"); + + b.Property("CreaterDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("EventDesc") + .HasColumnType("text"); + + b.Property("EventName") + .HasColumnType("text"); + + b.Property("EventStaus") + .HasColumnType("integer"); + + b.Property("FlowRuleRuleId") + .HasColumnType("uuid"); + + b.Property("MataData") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("EventId"); + + b.HasIndex("FlowRuleRuleId"); + + b.ToTable("BaseEvents"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseI18N", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AddDate") + .HasColumnType("timestamp without time zone"); + + b.Property("KeyName") + .HasColumnType("text"); + + b.Property("ResouceDesc") + .HasColumnType("text"); + + b.Property("ResouceGroupId") + .HasColumnType("integer"); + + b.Property("ResourceId") + .HasColumnType("bigint"); + + b.Property("ResourceKey") + .HasColumnType("text"); + + b.Property("ResourceTag") + .HasColumnType("text"); + + b.Property("ResourceType") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("ValueBG") + .HasColumnType("text"); + + b.Property("ValueCS") + .HasColumnType("text"); + + b.Property("ValueDA") + .HasColumnType("text"); + + b.Property("ValueDEDE") + .HasColumnType("text"); + + b.Property("ValueELGR") + .HasColumnType("text"); + + b.Property("ValueENGR") + .HasColumnType("text"); + + b.Property("ValueENUS") + .HasColumnType("text"); + + b.Property("ValueESES") + .HasColumnType("text"); + + b.Property("ValueFI") + .HasColumnType("text"); + + b.Property("ValueFRFR") + .HasColumnType("text"); + + b.Property("ValueHE") + .HasColumnType("text"); + + b.Property("ValueHRHR") + .HasColumnType("text"); + + b.Property("ValueHU") + .HasColumnType("text"); + + b.Property("ValueITIT") + .HasColumnType("text"); + + b.Property("ValueJAJP") + .HasColumnType("text"); + + b.Property("ValueKOKR") + .HasColumnType("text"); + + b.Property("ValueNL") + .HasColumnType("text"); + + b.Property("ValuePLPL") + .HasColumnType("text"); + + b.Property("ValuePT") + .HasColumnType("text"); + + b.Property("ValueSLSL") + .HasColumnType("text"); + + b.Property("ValueSR") + .HasColumnType("text"); + + b.Property("ValueSV") + .HasColumnType("text"); + + b.Property("ValueTRTR") + .HasColumnType("text"); + + b.Property("ValueUK") + .HasColumnType("text"); + + b.Property("ValueVI") + .HasColumnType("text"); + + b.Property("ValueZHCN") + .HasColumnType("text"); + + b.Property("ValueZHTW") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("BaseI18Ns"); + }); + + modelBuilder.Entity("IoTSharp.Data.Customer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Address") + .HasColumnType("text"); + + b.Property("City") + .HasColumnType("text"); + + b.Property("Country") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Phone") + .HasColumnType("text"); + + b.Property("Province") + .HasColumnType("text"); + + b.Property("Street") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("ZipCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("Customer"); + }); + + modelBuilder.Entity("IoTSharp.Data.DataStorage", b => + { + b.Property("Catalog") + .HasColumnType("integer"); + + b.Property("DeviceId") + .HasColumnType("uuid"); + + b.Property("KeyName") + .HasColumnType("text"); + + b.Property("DataSide") + .HasColumnType("integer"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Value_Binary") + .HasColumnType("bytea"); + + b.Property("Value_Boolean") + .HasColumnType("boolean"); + + b.Property("Value_DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Value_Double") + .HasColumnType("double precision"); + + b.Property("Value_Json") + .HasColumnType("jsonb"); + + b.Property("Value_Long") + .HasColumnType("bigint"); + + b.Property("Value_String") + .HasColumnType("text"); + + b.Property("Value_XML") + .HasColumnType("xml"); + + b.HasKey("Catalog", "DeviceId", "KeyName"); + + b.HasIndex("Catalog"); + + b.HasIndex("Catalog", "DeviceId"); + + b.ToTable("DataStorage"); + + b.HasDiscriminator("Catalog").HasValue(0); + }); + + modelBuilder.Entity("IoTSharp.Data.Device", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuthorizedKeyId") + .HasColumnType("uuid"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("DeviceType") + .HasColumnType("integer"); + + b.Property("LastActive") + .HasColumnType("timestamp without time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Online") + .HasColumnType("boolean"); + + b.Property("OwnerId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Timeout") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizedKeyId"); + + b.HasIndex("CustomerId"); + + b.HasIndex("OwnerId"); + + b.HasIndex("TenantId"); + + b.ToTable("Device"); + + b.HasDiscriminator("DeviceType").HasValue(0); + }); + + modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DeviceId") + .HasColumnType("uuid"); + + b.Property("IdentityId") + .IsRequired() + .HasColumnType("text"); + + b.Property("IdentityType") + .HasColumnType("integer"); + + b.Property("IdentityValue") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("DeviceId"); + + b.ToTable("DeviceIdentities"); + }); + + modelBuilder.Entity("IoTSharp.Data.DeviceRule", b => + { + b.Property("DeviceRuleId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConfigDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ConfigUser") + .HasColumnType("uuid"); + + b.Property("DeviceId") + .HasColumnType("uuid"); + + b.Property("FlowRuleRuleId") + .HasColumnType("uuid"); + + b.HasKey("DeviceRuleId"); + + b.HasIndex("DeviceId"); + + b.HasIndex("FlowRuleRuleId"); + + b.ToTable("DeviceRules"); + }); + + modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldInfo", b => + { + b.Property("FieldId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("FieldCode") + .HasColumnType("text"); + + b.Property("FieldCreateDate") + .HasColumnType("timestamp without time zone"); + + b.Property("FieldEditDate") + .HasColumnType("timestamp without time zone"); + + b.Property("FieldI18nKey") + .HasColumnType("text"); + + b.Property("FieldMaxLength") + .HasColumnType("integer"); + + b.Property("FieldName") + .HasColumnType("text"); + + b.Property("FieldPattern") + .HasColumnType("text"); + + b.Property("FieldPocoTypeName") + .HasColumnType("text"); + + b.Property("FieldStatus") + .HasColumnType("integer"); + + b.Property("FieldUIElement") + .HasColumnType("bigint"); + + b.Property("FieldUIElementSchema") + .HasColumnType("text"); + + b.Property("FieldUnit") + .HasColumnType("text"); + + b.Property("FieldValue") + .HasColumnType("text"); + + b.Property("FieldValueDataSource") + .HasColumnType("text"); + + b.Property("FieldValueLocalDataSource") + .HasColumnType("text"); + + b.Property("FieldValueType") + .HasColumnType("integer"); + + b.Property("FieldValueTypeName") + .HasColumnType("text"); + + b.Property("FormId") + .HasColumnType("bigint"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("IsRequired") + .HasColumnType("boolean"); + + b.HasKey("FieldId"); + + b.ToTable("DynamicFormFieldInfos"); + }); + + modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldValueInfo", b => + { + b.Property("FieldValueId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("BizId") + .HasColumnType("bigint"); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("FieldCode") + .HasColumnType("text"); + + b.Property("FieldCreateDate") + .HasColumnType("timestamp without time zone"); + + b.Property("FieldId") + .HasColumnType("bigint"); + + b.Property("FieldName") + .HasColumnType("text"); + + b.Property("FieldUnit") + .HasColumnType("text"); + + b.Property("FieldValue") + .HasColumnType("text"); + + b.Property("FieldValueType") + .HasColumnType("bigint"); + + b.Property("FromId") + .HasColumnType("bigint"); + + b.HasKey("FieldValueId"); + + b.ToTable("DynamicFormFieldValueInfos"); + }); + + modelBuilder.Entity("IoTSharp.Data.DynamicFormInfo", b => + { + b.Property("FormId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("BizId") + .HasColumnType("bigint"); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("FormCreator") + .HasColumnType("bigint"); + + b.Property("FormDesc") + .HasColumnType("text"); + + b.Property("FormLayout") + .HasColumnType("text"); + + b.Property("FormName") + .HasColumnType("text"); + + b.Property("FormSchame") + .HasColumnType("text"); + + b.Property("FormStatus") + .HasColumnType("integer"); + + b.Property("FromCreateDate") + .HasColumnType("timestamp without time zone"); + + b.Property("IsCompact") + .HasColumnType("boolean"); + + b.Property("ModelClass") + .HasColumnType("text"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("FormId"); + + b.ToTable("DynamicFormInfos"); + }); + + modelBuilder.Entity("IoTSharp.Data.Flow", b => + { + b.Property("FlowId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Conditionexpression") + .HasColumnType("text"); + + b.Property("CreateDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreateId") + .HasColumnType("uuid"); + + b.Property("Createor") + .HasColumnType("uuid"); + + b.Property("ExecutorId") + .HasColumnType("uuid"); + + b.Property("FlowRuleRuleId") + .HasColumnType("uuid"); + + b.Property("FlowStatus") + .HasColumnType("integer"); + + b.Property("FlowType") + .HasColumnType("text"); + + b.Property("Flowdesc") + .HasColumnType("text"); + + b.Property("Flowname") + .HasColumnType("text"); + + b.Property("Incoming") + .HasColumnType("text"); + + b.Property("NodeProcessClass") + .HasColumnType("text"); + + b.Property("NodeProcessMethod") + .HasColumnType("text"); + + b.Property("NodeProcessParams") + .HasColumnType("text"); + + b.Property("NodeProcessScript") + .HasColumnType("text"); + + b.Property("NodeProcessScriptType") + .HasColumnType("text"); + + b.Property("NodeProcessType") + .HasColumnType("text"); + + b.Property("ObjectId") + .HasColumnType("text"); + + b.Property("Outgoing") + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("text"); + + b.Property("TargetId") + .HasColumnType("text"); + + b.Property("TestStatus") + .HasColumnType("integer"); + + b.Property("Tester") + .HasColumnType("uuid"); + + b.Property("TesterDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("bpmnid") + .HasColumnType("text"); + + b.HasKey("FlowId"); + + b.HasIndex("ExecutorId"); + + b.HasIndex("FlowRuleRuleId"); + + b.ToTable("Flows"); + }); + + modelBuilder.Entity("IoTSharp.Data.FlowOperation", b => + { + b.Property("OperationId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AddDate") + .HasColumnType("timestamp without time zone"); + + b.Property("BaseEventEventId") + .HasColumnType("uuid"); + + b.Property("BizId") + .HasColumnType("text"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("FlowId") + .HasColumnType("uuid"); + + b.Property("FlowRuleRuleId") + .HasColumnType("uuid"); + + b.Property("NodeStatus") + .HasColumnType("integer"); + + b.Property("OperationDesc") + .HasColumnType("text"); + + b.Property("Step") + .HasColumnType("integer"); + + b.Property("Tag") + .HasColumnType("text"); + + b.Property("bpmnid") + .HasColumnType("text"); + + b.HasKey("OperationId"); + + b.HasIndex("BaseEventEventId"); + + b.HasIndex("FlowId"); + + b.HasIndex("FlowRuleRuleId"); + + b.ToTable("FlowOperations"); + }); + + modelBuilder.Entity("IoTSharp.Data.FlowRule", b => + { + b.Property("RuleId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Creator") + .HasColumnType("text"); + + b.Property("DefinitionsXml") + .HasColumnType("text"); + + b.Property("Describes") + .HasColumnType("text"); + + b.Property("ExecutableCode") + .HasColumnType("text"); + + b.Property("MountType") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentRuleId") + .HasColumnType("uuid"); + + b.Property("RuleDesc") + .HasColumnType("text"); + + b.Property("RuleStatus") + .HasColumnType("integer"); + + b.Property("RuleType") + .HasColumnType("integer"); + + b.Property("Runner") + .HasColumnType("text"); + + b.Property("SubVersion") + .HasColumnType("double precision"); + + b.HasKey("RuleId"); + + b.ToTable("FlowRules"); + }); + + modelBuilder.Entity("IoTSharp.Data.Relationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("IdentityUserId") + .HasColumnType("text"); + + b.Property("TenantId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("IdentityUserId"); + + b.HasIndex("TenantId"); + + b.ToTable("Relationship"); + }); + + modelBuilder.Entity("IoTSharp.Data.RuleTaskExecutor", b => + { + b.Property("ExecutorId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AddDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Creator") + .HasColumnType("uuid"); + + b.Property("DefaultConfig") + .HasColumnType("text"); + + b.Property("ExecutorDesc") + .HasColumnType("text"); + + b.Property("ExecutorName") + .HasColumnType("text"); + + b.Property("ExecutorStatus") + .HasColumnType("integer"); + + b.Property("MataData") + .HasColumnType("text"); + + b.Property("Path") + .HasColumnType("text"); + + b.Property("Tag") + .HasColumnType("text"); + + b.Property("TestStatus") + .HasColumnType("integer"); + + b.Property("Tester") + .HasColumnType("uuid"); + + b.Property("TesterDateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TypeName") + .HasColumnType("text"); + + b.HasKey("ExecutorId"); + + b.ToTable("RuleTaskExecutors"); + }); + + modelBuilder.Entity("IoTSharp.Data.TelemetryData", b => + { + b.Property("DeviceId") + .HasColumnType("uuid"); + + b.Property("KeyName") + .HasColumnType("text"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DataSide") + .HasColumnType("integer"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Value_Binary") + .HasColumnType("bytea"); + + b.Property("Value_Boolean") + .HasColumnType("boolean"); + + b.Property("Value_DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Value_Double") + .HasColumnType("double precision"); + + b.Property("Value_Json") + .HasColumnType("jsonb"); + + b.Property("Value_Long") + .HasColumnType("bigint"); + + b.Property("Value_String") + .HasColumnType("text"); + + b.Property("Value_XML") + .HasColumnType("xml"); + + b.HasKey("DeviceId", "KeyName", "DateTime"); + + b.HasIndex("DeviceId"); + + b.HasIndex("KeyName"); + + b.HasIndex("DeviceId", "KeyName"); + + b.ToTable("TelemetryData"); + }); + + modelBuilder.Entity("IoTSharp.Data.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Address") + .HasColumnType("text"); + + b.Property("City") + .HasColumnType("text"); + + b.Property("Country") + .HasColumnType("text"); + + b.Property("EMail") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Phone") + .HasColumnType("text"); + + b.Property("Province") + .HasColumnType("text"); + + b.Property("Street") + .HasColumnType("text"); + + b.Property("ZipCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Tenant"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b => + { + b.HasBaseType("IoTSharp.Data.DataStorage"); + + b.HasDiscriminator().HasValue(2); + }); + + modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b => + { + b.HasBaseType("IoTSharp.Data.DataStorage"); + + b.HasDiscriminator().HasValue(4); + }); + + modelBuilder.Entity("IoTSharp.Data.Gateway", b => + { + b.HasBaseType("IoTSharp.Data.Device"); + + b.HasDiscriminator().HasValue(1); + }); + + modelBuilder.Entity("IoTSharp.Data.AuditLog", b => + { + b.HasOne("IoTSharp.Data.Customer", "Customer") + .WithMany() + .HasForeignKey("CustomerId"); + + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId"); + + b.Navigation("Customer"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b => + { + b.HasOne("IoTSharp.Data.Customer", "Customer") + .WithMany() + .HasForeignKey("CustomerId"); + + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId"); + + b.Navigation("Customer"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("IoTSharp.Data.BaseEvent", b => + { + b.HasOne("IoTSharp.Data.FlowRule", "FlowRule") + .WithMany() + .HasForeignKey("FlowRuleRuleId"); + + b.Navigation("FlowRule"); + }); + + modelBuilder.Entity("IoTSharp.Data.Customer", b => + { + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany("Customers") + .HasForeignKey("TenantId"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("IoTSharp.Data.Device", b => + { + b.HasOne("IoTSharp.Data.AuthorizedKey", null) + .WithMany("Devices") + .HasForeignKey("AuthorizedKeyId"); + + b.HasOne("IoTSharp.Data.Customer", "Customer") + .WithMany("Devices") + .HasForeignKey("CustomerId"); + + b.HasOne("IoTSharp.Data.Gateway", "Owner") + .WithMany("Children") + .HasForeignKey("OwnerId"); + + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany("Devices") + .HasForeignKey("TenantId"); + + b.Navigation("Customer"); + + b.Navigation("Owner"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b => + { + b.HasOne("IoTSharp.Data.Device", "Device") + .WithMany() + .HasForeignKey("DeviceId"); + + b.Navigation("Device"); + }); + + modelBuilder.Entity("IoTSharp.Data.DeviceRule", b => + { + b.HasOne("IoTSharp.Data.Device", "Device") + .WithMany() + .HasForeignKey("DeviceId"); + + b.HasOne("IoTSharp.Data.FlowRule", "FlowRule") + .WithMany() + .HasForeignKey("FlowRuleRuleId"); + + b.Navigation("Device"); + + b.Navigation("FlowRule"); + }); + + modelBuilder.Entity("IoTSharp.Data.Flow", b => + { + b.HasOne("IoTSharp.Data.RuleTaskExecutor", "Executor") + .WithMany() + .HasForeignKey("ExecutorId"); + + b.HasOne("IoTSharp.Data.FlowRule", "FlowRule") + .WithMany() + .HasForeignKey("FlowRuleRuleId"); + + b.Navigation("Executor"); + + b.Navigation("FlowRule"); + }); + + modelBuilder.Entity("IoTSharp.Data.FlowOperation", b => + { + b.HasOne("IoTSharp.Data.BaseEvent", "BaseEvent") + .WithMany() + .HasForeignKey("BaseEventEventId"); + + b.HasOne("IoTSharp.Data.Flow", "Flow") + .WithMany() + .HasForeignKey("FlowId"); + + b.HasOne("IoTSharp.Data.FlowRule", "FlowRule") + .WithMany() + .HasForeignKey("FlowRuleRuleId"); + + b.Navigation("BaseEvent"); + + b.Navigation("Flow"); + + b.Navigation("FlowRule"); + }); + + modelBuilder.Entity("IoTSharp.Data.Relationship", b => + { + b.HasOne("IoTSharp.Data.Customer", "Customer") + .WithMany() + .HasForeignKey("CustomerId"); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "IdentityUser") + .WithMany() + .HasForeignKey("IdentityUserId"); + + b.HasOne("IoTSharp.Data.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId"); + + b.Navigation("Customer"); + + b.Navigation("IdentityUser"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b => + { + b.Navigation("Devices"); + }); + + modelBuilder.Entity("IoTSharp.Data.Customer", b => + { + b.Navigation("Devices"); + }); + + modelBuilder.Entity("IoTSharp.Data.Tenant", b => + { + b.Navigation("Customers"); + + b.Navigation("Devices"); + }); + + modelBuilder.Entity("IoTSharp.Data.Gateway", b => + { + b.Navigation("Children"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/IoTSharp.Data.PostgreSQL/Migrations/20211103101343_modifyrulemounttype.cs b/IoTSharp.Data.PostgreSQL/Migrations/20211103101343_modifyrulemounttype.cs new file mode 100644 index 00000000..f3a53327 --- /dev/null +++ b/IoTSharp.Data.PostgreSQL/Migrations/20211103101343_modifyrulemounttype.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace IoTSharp.Migrations +{ + public partial class modifyrulemounttype : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/IoTSharp.Data.PostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs b/IoTSharp.Data.PostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs index 76d63082..986aaba3 100644 --- a/IoTSharp.Data.PostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/IoTSharp.Data.PostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs @@ -866,6 +866,9 @@ namespace IoTSharp.Migrations b.Property("ExecutableCode") .HasColumnType("text"); + b.Property("MountType") + .HasColumnType("integer"); + b.Property("Name") .IsRequired() .HasColumnType("text"); diff --git a/IoTSharp.Data/Enums.cs b/IoTSharp.Data/Enums.cs index f12ad910..47cb6e5a 100644 --- a/IoTSharp.Data/Enums.cs +++ b/IoTSharp.Data/Enums.cs @@ -154,5 +154,14 @@ namespace IoTSharp.Data CoAP, HTTP } + public enum MountType + { + Telemetry=1, + Attribute=2, + RAW=3 + } + + + } \ No newline at end of file diff --git a/IoTSharp.Data/FlowRule.cs b/IoTSharp.Data/FlowRule.cs index 064323c6..cf9420d3 100644 --- a/IoTSharp.Data/FlowRule.cs +++ b/IoTSharp.Data/FlowRule.cs @@ -23,5 +23,7 @@ namespace IoTSharp.Data public string DefinitionsXml { get; set; } public Guid ParentRuleId { get; set; } public double SubVersion { get; set; } + + public MountType MountType { get; set; } } } diff --git a/IoTSharp.TaskAction/ITaskAction.cs b/IoTSharp.TaskAction/ITaskAction.cs index 93dc1bc4..ce360956 100644 --- a/IoTSharp.TaskAction/ITaskAction.cs +++ b/IoTSharp.TaskAction/ITaskAction.cs @@ -17,8 +17,8 @@ namespace IoTSharp.TaskAction private dynamic _DynamicOutput; private readonly ExpandoObjectConverter expConverter = new(); public Guid DeviceId { get; set; } - public bool ExxcutionStatus { get; set; } - public string ExxcutionInfo { get; set; } + public bool ExecutionStatus { get; set; } + public string ExecutionInfo { get; set; } public dynamic DynamicOutput { get diff --git a/IoTSharp.TaskAction/MessagePullExcutor.cs b/IoTSharp.TaskAction/MessagePullExcutor.cs index 43774ed0..954e0eae 100644 --- a/IoTSharp.TaskAction/MessagePullExcutor.cs +++ b/IoTSharp.TaskAction/MessagePullExcutor.cs @@ -35,7 +35,7 @@ namespace IoTSharp.TaskAction } catch (Exception ex) { - return new TaskActionOutput() {ExxcutionInfo = ex.Message, ExxcutionStatus = false}; + return new TaskActionOutput() {ExecutionInfo = ex.Message, ExecutionStatus = false}; } } diff --git a/IoTSharp/ClientApp/src/app/layout/basic/widgets/notify.component.ts b/IoTSharp/ClientApp/src/app/layout/basic/widgets/notify.component.ts index 3cb03a7f..e990dab3 100644 --- a/IoTSharp/ClientApp/src/app/layout/basic/widgets/notify.component.ts +++ b/IoTSharp/ClientApp/src/app/layout/basic/widgets/notify.component.ts @@ -82,98 +82,98 @@ export class HeaderNotifyComponent { setTimeout(() => { const now = new Date(); this.data = this.updateNoticeData([ - { - id: '000000001', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', - title: '你收到了 14 份新周报', - datetime: add(now, { days: 10 }), - type: '通知', - }, - { - id: '000000002', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', - title: '你推荐的 曲妮妮 已通过第三轮面试', - datetime: add(now, { days: -3 }), - type: '通知', - }, - { - id: '000000003', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png', - title: '这种模板可以区分多种通知类型', - datetime: add(now, { months: -3 }), - read: true, - type: '通知', - }, - { - id: '000000004', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', - title: '左侧图标用于区分不同的类型', - datetime: add(now, { years: -1 }), - type: '通知', - }, - { - id: '000000005', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', - title: '内容不要超过两行字,超出时自动截断', - datetime: '2017-08-07', - type: '通知', - }, - { - id: '000000006', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '曲丽丽 评论了你', - description: '描述信息描述信息描述信息', - datetime: '2017-08-07', - type: '消息', - }, - { - id: '000000007', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '朱偏右 回复了你', - description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', - datetime: '2017-08-07', - type: '消息', - }, - { - id: '000000008', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '标题', - description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', - datetime: '2017-08-07', - type: '消息', - }, - { - id: '000000009', - title: '任务名称', - description: '任务需要在 2017-01-12 20:00 前启动', - extra: '未开始', - status: 'todo', - type: '待办', - }, - { - id: '000000010', - title: '第三方紧急代码变更', - description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', - extra: '马上到期', - status: 'urgent', - type: '待办', - }, - { - id: '000000011', - title: '信息安全考试', - description: '指派竹尔于 2017-01-09 前完成更新并发布', - extra: '已耗时 8 天', - status: 'doing', - type: '待办', - }, - { - id: '000000012', - title: 'ABCD 版本发布', - description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', - extra: '进行中', - status: 'processing', - type: '待办', - }, + // { + // id: '000000001', + // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', + // title: '你收到了 14 份新周报', + // datetime: add(now, { days: 10 }), + // type: '通知', + // }, + // { + // id: '000000002', + // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', + // title: '你推荐的 曲妮妮 已通过第三轮面试', + // datetime: add(now, { days: -3 }), + // type: '通知', + // }, + // { + // id: '000000003', + // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png', + // title: '这种模板可以区分多种通知类型', + // datetime: add(now, { months: -3 }), + // read: true, + // type: '通知', + // }, + // { + // id: '000000004', + // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', + // title: '左侧图标用于区分不同的类型', + // datetime: add(now, { years: -1 }), + // type: '通知', + // }, + // { + // id: '000000005', + // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', + // title: '内容不要超过两行字,超出时自动截断', + // datetime: '2017-08-07', + // type: '通知', + // }, + // { + // id: '000000006', + // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', + // title: '曲丽丽 评论了你', + // description: '描述信息描述信息描述信息', + // datetime: '2017-08-07', + // type: '消息', + // }, + // { + // id: '000000007', + // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', + // title: '朱偏右 回复了你', + // description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', + // datetime: '2017-08-07', + // type: '消息', + // }, + // { + // id: '000000008', + // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', + // title: '标题', + // description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', + // datetime: '2017-08-07', + // type: '消息', + // }, + // { + // id: '000000009', + // title: '任务名称', + // description: '任务需要在 2017-01-12 20:00 前启动', + // extra: '未开始', + // status: 'todo', + // type: '待办', + // }, + // { + // id: '000000010', + // title: '第三方紧急代码变更', + // description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', + // extra: '马上到期', + // status: 'urgent', + // type: '待办', + // }, + // { + // id: '000000011', + // title: '信息安全考试', + // description: '指派竹尔于 2017-01-09 前完成更新并发布', + // extra: '已耗时 8 天', + // status: 'doing', + // type: '待办', + // }, + // { + // id: '000000012', + // title: 'ABCD 版本发布', + // description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', + // extra: '进行中', + // status: 'processing', + // type: '待办', + // }, ]); this.loading = false; diff --git a/IoTSharp/ClientApp/src/app/layout/basic/widgets/task.component.ts b/IoTSharp/ClientApp/src/app/layout/basic/widgets/task.component.ts index d82f9d3a..78d4855a 100644 --- a/IoTSharp/ClientApp/src/app/layout/basic/widgets/task.component.ts +++ b/IoTSharp/ClientApp/src/app/layout/basic/widgets/task.component.ts @@ -20,7 +20,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/
-
+
See All
diff --git a/IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.html b/IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.html index a08da0a5..8202598d 100644 --- a/IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.html +++ b/IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.html @@ -22,8 +22,6 @@ {{ 'button.new' | translate }} --> - -
@@ -32,7 +30,6 @@ {{ 'button.new' | translate }} -
- - + @@ -72,20 +70,46 @@ -
- - - - - - - - - - -
属性名称属性值时间
{{ _item.keyName }}{{ _item.value }}{{ _item.dateTime }}
-
+ + + + + 图表 + + + +
+ +
+ + +
+
+ + +
+ + + + 数据 + + + + + + + + + + + + + +
属性名称属性值时间
{{ _item.keyName }}{{ _item.value }}{{ _item.dateTime }}
+
+
+ @@ -98,11 +122,17 @@
{{ _item.name }} {{ _item.ruleDesc }} - - +
diff --git a/IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.ts b/IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.ts index 50957b23..dc276987 100644 --- a/IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.ts +++ b/IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.ts @@ -18,6 +18,7 @@ import { HttpHeaders, HttpResponse } from '@angular/common/http'; import { saveAs, fileSaver } from 'file-saver'; import { ClipboardService } from 'ngx-clipboard'; import { DevicetokendialogComponent } from '../devicetokendialog/devicetokendialog.component'; +import { fork } from 'child_process'; @Component({ selector: 'app-devicelist', templateUrl: './devicelist.component.html', @@ -37,17 +38,16 @@ export class DevicelistComponent implements OnInit, OnDestroy { private drawerService: NzDrawerService, private settingService: SettingsService, - aclSrv: ACLService, - ) { } + ) {} ngOnDestroy(): void { if (this.obs) { this.obs.unsubscribe(); } } url = 'api/Devices/Customers'; - - page: STPage = { + cetd : telemetryitem []= []; +page: STPage = { front: false, total: true, zeroIndexed: true, @@ -60,12 +60,12 @@ export class DevicelistComponent implements OnInit, OnDestroy { name: string; // anothor query field:The type you expect } = { - pi: 0, - ps: 10, - sorter: '', - customerId: '', - name: '', - }; + pi: 0, + ps: 10, + sorter: '', + customerId: '', + name: '', + }; req: STReq = { method: 'GET', allInBody: true, reName: { pi: 'offset', ps: 'limit' }, params: this.q }; // 定义返回的参数 @@ -86,8 +86,8 @@ export class DevicelistComponent implements OnInit, OnDestroy { { title: 'id', index: 'id' }, { title: '名称', index: 'name', render: 'name' }, { title: '设备类型', index: 'deviceType' }, - { title: '所有者', index: 'phone' }, - { title: '租户', index: 'country' }, + { title: '在线状态', index: 'online' }, + { title: '最后活动时间', index: 'lastActive' }, { title: '客户', index: 'province' }, { title: '操作', @@ -113,7 +113,7 @@ export class DevicelistComponent implements OnInit, OnDestroy { acl: 111, text: '设置规则', click: (item: any) => { - this.download() + this.download(); this.downlink([item]); }, }, @@ -125,15 +125,9 @@ export class DevicelistComponent implements OnInit, OnDestroy { modal: { component: DevicetokendialogComponent, }, - click: (item: any) => { - - - - } + click: (item: any) => {}, }, - - { acl: 110, text: '删除', @@ -148,37 +142,33 @@ export class DevicelistComponent implements OnInit, OnDestroy { description = ''; totalCallNo = 0; - getbuttons(item) { - - - - - return [] - + return []; } + couponFormat(value) {} - - private download(){ + private download() { this.http - .get('./assets/tmp/demo.xlsx', {},{ - responseType: 'blob', - }) - .subscribe(res => { - let url = window.URL.createObjectURL(res); - let a = document.createElement('a'); - document.body.appendChild(a); - a.setAttribute('style', 'display: none'); - a.href = url; - a.download = res.filename; - a.click(); - window.URL.revokeObjectURL(url); - a.remove(); - }); - + .get( + './assets/tmp/demo.xlsx', + {}, + { + responseType: 'blob', + }, + ) + .subscribe((res) => { + let url = window.URL.createObjectURL(res); + let a = document.createElement('a'); + document.body.appendChild(a); + a.setAttribute('style', 'display: none'); + a.href = url; + a.download = res.filename; + a.click(); + window.URL.revokeObjectURL(url); + a.remove(); + }); } - ngOnInit(): void { this.router.queryParams.subscribe( @@ -194,8 +184,8 @@ export class DevicelistComponent implements OnInit, OnDestroy { this.url = 'api/Devices/Customers'; } }, - (y) => { }, - () => { }, + (y) => {}, + () => {}, ); } @@ -229,7 +219,7 @@ export class DevicelistComponent implements OnInit, OnDestroy { drawerRef.afterOpen.subscribe(() => { this.getData(); }); - drawerRef.afterClose.subscribe((data) => { }); + drawerRef.afterClose.subscribe((data) => {}); } edit(id: string): void { var { nzMaskClosable, width } = this.settingService.getData('drawerconfig'); @@ -255,7 +245,7 @@ export class DevicelistComponent implements OnInit, OnDestroy { }, }, }); - drawerRef.afterOpen.subscribe(() => { }); + drawerRef.afterOpen.subscribe(() => {}); drawerRef.afterClose.subscribe((data) => { this.getData(); }); @@ -288,18 +278,18 @@ export class DevicelistComponent implements OnInit, OnDestroy { drawerRef.afterOpen.subscribe(() => { this.getData(); }); - drawerRef.afterClose.subscribe((data) => { }); + drawerRef.afterClose.subscribe((data) => {}); } - reset() { } + reset() {} delete(id: string) { this.http.delete('/api/Devices/' + id, {}).subscribe( (x) => { this.msg.info('设备已删除'); this.getData(); }, - (y) => { }, - () => { }, + (y) => {}, + () => {}, ); } @@ -320,31 +310,27 @@ export class DevicelistComponent implements OnInit, OnDestroy { this.http.get>('api/Devices/' + $events.expand?.id + '/AttributeLatest'), this.http.get>('api/Rules/GetDeviceRules?deviceId=' + $events.expand?.id), this.http.get>('api/Devices/' + $events.expand?.id + '/TelemetryLatest'), - ).subscribe( - ([ - attributes, - rules, - telemetries - ]) => { - $events.expand.attributes = attributes.data; - $events.expand.rules = rules.data; - $events.expand.telemetries = telemetries.data; - this.cdr.detectChanges(); - }, - ); - + ).subscribe(([attributes, rules, telemetries]) => { + $events.expand.attributes = attributes.data; + $events.expand.rules = rules.data; + $events.expand.telemetries = telemetries.data; + + if (this.cetd.length === 0) { + this.cetd = $events.expand.telemetries; + } else { + for (var i = 0; i < this.cetd.length; i++) { + this.cetd[i].value= telemetries.data[i].value + + } + } + + // this.cdr.detectChanges(); + }); }); - - } else { - this.obs.unsubscribe(); - } - - - break; } } @@ -354,8 +340,8 @@ export class DevicelistComponent implements OnInit, OnDestroy { (next) => { item.rules = item.rules.filter((x) => x.ruleId != rule.ruleId); }, - (error) => { }, - () => { }, + (error) => {}, + () => {}, ); } } diff --git a/IoTSharp/ClientApp/src/app/routes/flow/flowform/flowform.component.html b/IoTSharp/ClientApp/src/app/routes/flow/flowform/flowform.component.html index 5801807a..5299bbc0 100644 --- a/IoTSharp/ClientApp/src/app/routes/flow/flowform/flowform.component.html +++ b/IoTSharp/ClientApp/src/app/routes/flow/flowform/flowform.component.html @@ -4,7 +4,15 @@ + + + + + + + + diff --git a/IoTSharp/ClientApp/src/app/routes/flow/flowform/flowform.component.ts b/IoTSharp/ClientApp/src/app/routes/flow/flowform/flowform.component.ts index a7bd8408..2b05a45a 100644 --- a/IoTSharp/ClientApp/src/app/routes/flow/flowform/flowform.component.ts +++ b/IoTSharp/ClientApp/src/app/routes/flow/flowform/flowform.component.ts @@ -32,12 +32,14 @@ export class FlowformComponent implements OnInit { this.form = this.fb.group({ name: [null, [Validators.required]], ruleDesc: [null, []], + mountType: [null, [Validators.required]], ruleId: [Guid.EMPTY, []], }); if (this.id !== Guid.EMPTY) { this._httpClient.get('api/rules/get?id=' + this.id).subscribe( (x) => { + x.data.mountType= x.data.mountType+''; this.form.patchValue(x.data); }, (y) => {}, diff --git a/IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.html b/IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.html index cc007fb6..64899a47 100644 --- a/IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.html +++ b/IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.html @@ -102,7 +102,7 @@ }} {{ - _item.flowType==='bpmn:Task'?'条件测试':'' + _item.flowType==='bpmn:Task'|| _item.flowType==='bpmn:StartEvent'?'条件测试':'' }} diff --git a/IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.ts b/IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.ts index 49023fc7..586a0841 100644 --- a/IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.ts +++ b/IoTSharp/ClientApp/src/app/routes/flow/flowlist/flowlist.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectorRef, Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; -import { STColumn, STComponent, STData, STPage, STReq, STRes } from '@delon/abc/st'; +import { STColumn, STColumnTag, STComponent, STData, STPage, STReq, STRes } from '@delon/abc/st'; import { ACLService } from '@delon/acl'; import { _HttpClient, ModalHelper, SettingsService } from '@delon/theme'; import { Guid } from 'guid-typescript'; @@ -30,7 +30,11 @@ export class FlowlistComponent implements OnInit { private settingService: SettingsService, ) {} - + TAG: STColumnTag = { + 1: { text: '遥测', color: 'green' }, + 2: { text: '属性', color: 'orange' }, + 3: { text: 'RAW', color: 'orange' }, + }; page: STPage = { front: false, total: true, @@ -75,11 +79,12 @@ export class FlowlistComponent implements OnInit { { title: 'id', index: 'ruleId' }, { title: '规则名称', index: 'name', render: 'name' }, { title: '备注', index: 'ruledesc' }, - { title: '创建时间', type: 'date', index: 'CreatTime' }, + { title: '创建时间', type: 'date', index: 'creatTime' }, + { title: '挂载点', type: 'tag', index: 'mountType', tag:this.TAG }, { title: { i18n: 'i18n.columns.Status' }, - index: 'rulestatus', - render: 'rulestatus', + index: 'ruleStatus', + render: 'ruleStatus', type: 'badge', badge: { 0: { text: '禁用', color: 'error' }, @@ -233,6 +238,7 @@ export class FlowlistComponent implements OnInit { switch (flow.flowType) { case 'bpmn:Task': + { var { nzMaskClosable, width } = this.settingService.getData('drawerconfig'); var title = '测试' + (flow.flowname??flow.bpmnid); const drawerRef = this.drawerService.create({ @@ -249,8 +255,28 @@ export class FlowlistComponent implements OnInit { if (typeof data === 'string') { } }); + } break; - case 'bpmn:SequenceFlow': + case 'bpmn:StartEvent': + { + var { nzMaskClosable, width } = this.settingService.getData('drawerconfig'); + var title = '测试' + (flow.flowname??flow.bpmnid); + const drawerRef = this.drawerService.create({ + nzTitle: title, + nzContent: SequenceflowtesterComponent, + nzWidth: width < 1280 ? 1280 : width, + nzMaskClosable: nzMaskClosable, + nzContentParams: { + flow: flow, + }, + }); + drawerRef.afterOpen.subscribe(() => {}); + drawerRef.afterClose.subscribe((data) => { + if (typeof data === 'string') { + } + }); + } + break; } } diff --git a/IoTSharp/ClientApp/src/app/routes/routes.module.ts b/IoTSharp/ClientApp/src/app/routes/routes.module.ts index f834781a..24f81b57 100644 --- a/IoTSharp/ClientApp/src/app/routes/routes.module.ts +++ b/IoTSharp/ClientApp/src/app/routes/routes.module.ts @@ -65,11 +65,12 @@ import { TaskexecutorformComponent } from './flow/taskexecutorform/taskexecutorf import { SequenceflowtesterComponent } from './flow/sequenceflowtester/sequenceflowtester.component'; import { TasktesterComponent } from './flow/tasktester/tasktester.component'; import { ForkdialogComponent } from './flow/forkdialog/forkdialog.component'; +import { G2BarModule,G2GaugeModule } from '@delon/chart'; const COMPONENTS: Type[] = []; const Directive: Type[] = [fielddirective, controldirective]; @NgModule({ - imports: [SharedModule, RouteRoutingModule, WidgetsModule,ClipboardModule, DelonFormModule.forRoot()], + imports: [SharedModule,G2BarModule,G2GaugeModule , RouteRoutingModule, WidgetsModule,ClipboardModule, DelonFormModule.forRoot()], declarations: [ ...COMPONENTS, ...Directive, diff --git a/IoTSharp/Controllers/DevicesController.cs b/IoTSharp/Controllers/DevicesController.cs index 88d1de48..09a5bac2 100644 --- a/IoTSharp/Controllers/DevicesController.cs +++ b/IoTSharp/Controllers/DevicesController.cs @@ -242,6 +242,25 @@ namespace IoTSharp.Controllers [ProducesDefaultResponseType] public async Task>> GetTelemetryLatest(Guid deviceId) { + + + + Random r = new Random((int) System.DateTime.Now.Ticks); + var l = new List(); + for (int i = 0; i < 10; i++) + { + TelemetryDataDto t= new TelemetryDataDto(); + t.Value = r.Next(1,10); + t.KeyName = "tele"+i; + t.DateTime= DateTime.Now; + t.DataType = DataType.Double; + l.Add(t); + } + + return new ApiResult>(ApiCode.Success, "Ok", + l); + + Device dev = Found(deviceId); if (dev == null) { diff --git a/IoTSharp/Controllers/RulesController.cs b/IoTSharp/Controllers/RulesController.cs index 2c68ae6a..46b9410b 100644 --- a/IoTSharp/Controllers/RulesController.cs +++ b/IoTSharp/Controllers/RulesController.cs @@ -104,7 +104,10 @@ namespace IoTSharp.Controllers { if (ModelState.IsValid) { + m.MountType = m.MountType; m.RuleStatus = 1; + m.CreatTime=DateTime.Now; + _context.FlowRules.Add(m); _context.SaveChanges(); @@ -122,6 +125,7 @@ namespace IoTSharp.Controllers var flowrule = _context.FlowRules.SingleOrDefault(c => c.RuleId == m.RuleId); if (flowrule != null) { + flowrule.MountType = m.MountType; flowrule.Name = m.Name; flowrule.RuleDesc = m.RuleDesc; _context.FlowRules.Update(flowrule); diff --git a/IoTSharp/IoTSharp.csproj b/IoTSharp/IoTSharp.csproj index 7953e4f9..76d9f23c 100644 --- a/IoTSharp/IoTSharp.csproj +++ b/IoTSharp/IoTSharp.csproj @@ -95,6 +95,7 @@ + -- GitLab