Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
IoTSharp
IoTSharp
提交
4650c4dd
IoTSharp
项目概览
IoTSharp
/
IoTSharp
10 个月 前同步成功
通知
15
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
IoTSharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4650c4dd
编写于
12月 17, 2021
作者:
W
wq1234wq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
设备活动日期格式化,移除部分脚本选项,修正保存执行历史指定导航属性报错的问题
上级
07a4d3c6
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
2166 addition
and
37 deletion
+2166
-37
IoTSharp.Data.PostgreSQL/Migrations/20211217110202_modyfyflowoperation.Designer.cs
...Migrations/20211217110202_modyfyflowoperation.Designer.cs
+1871
-0
IoTSharp.Data.PostgreSQL/Migrations/20211217110202_modyfyflowoperation.cs
...stgreSQL/Migrations/20211217110202_modyfyflowoperation.cs
+182
-0
IoTSharp.Data.PostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs
...ostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs
+14
-8
IoTSharp.Data/FlowOperation.cs
IoTSharp.Data/FlowOperation.cs
+3
-3
IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.ts
.../src/app/routes/device/devicelist/devicelist.component.ts
+1
-1
IoTSharp/ClientApp/src/app/routes/flow/diagram/diagram.component.html
...entApp/src/app/routes/flow/diagram/diagram.component.html
+1
-4
IoTSharp/ClientApp/src/app/routes/flow/floweventview/floweventview.component.ts
.../app/routes/flow/floweventview/floweventview.component.ts
+1
-1
IoTSharp/Controllers/RulesController.cs
IoTSharp/Controllers/RulesController.cs
+24
-20
IoTSharp/Dtos/FlowOperationDto.cs
IoTSharp/Dtos/FlowOperationDto.cs
+27
-0
IoTSharp/FlowRuleEngine/FlowRuleProcessor.cs
IoTSharp/FlowRuleEngine/FlowRuleProcessor.cs
+37
-0
IoTSharp/IoTSharp.xml
IoTSharp/IoTSharp.xml
+5
-0
未找到文件。
IoTSharp.Data.PostgreSQL/Migrations/20211217110202_modyfyflowoperation.Designer.cs
0 → 100644
浏览文件 @
4650c4dd
// <auto-generated />
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
(
"20211217110202_modyfyflowoperation"
)]
partial
class
modyfyflowoperation
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
#pragma warning disable 612, 618
modelBuilder
.
HasAnnotation
(
"Relational:MaxIdentifierLength"
,
63
)
.
HasAnnotation
(
"ProductVersion"
,
"5.0.12"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
modelBuilder
.
Entity
(
"IoTSharp.Data.AuditLog"
,
b
=>
{
b
.
Property
<
Guid
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"ActionData"
)
.
HasColumnType
(
"jsonb"
);
b
.
Property
<
string
>(
"ActionName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ActionResult"
)
.
HasColumnType
(
"jsonb"
);
b
.
Property
<
DateTime
>(
"ActiveDateTime"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
?>(
"CustomerId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
>(
"ObjectID"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"ObjectName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"ObjectType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
?>(
"TenantId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"UserId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"UserName"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"CustomerId"
);
b
.
HasIndex
(
"TenantId"
);
b
.
ToTable
(
"AuditLog"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.AuthorizedKey"
,
b
=>
{
b
.
Property
<
Guid
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"AuthToken"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
?>(
"CustomerId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
?>(
"TenantId"
)
.
HasColumnType
(
"uuid"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"CustomerId"
);
b
.
HasIndex
(
"TenantId"
);
b
.
ToTable
(
"AuthorizedKeys"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.BaseDictionary"
,
b
=>
{
b
.
Property
<
long
>(
"DictionaryId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bigint"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"Dictionary18NKeyName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DictionaryColor"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DictionaryDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
long
?>(
"DictionaryGroupId"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
string
>(
"DictionaryIcon"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DictionaryName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DictionaryPattern"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"DictionaryStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"DictionaryTag"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DictionaryValue"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"DictionaryValueType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"DictionaryValueTypeName"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"DictionaryId"
);
b
.
ToTable
(
"BaseDictionaries"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.BaseDictionaryGroup"
,
b
=>
{
b
.
Property
<
long
>(
"DictionaryGroupId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bigint"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"DictionaryGroup18NKeyName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DictionaryGroupDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DictionaryGroupKey"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DictionaryGroupName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"DictionaryGroupStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
?>(
"DictionaryGroupValueType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"DictionaryGroupValueTypeName"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"DictionaryGroupId"
);
b
.
ToTable
(
"BaseDictionaryGroups"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.BaseEvent"
,
b
=>
{
b
.
Property
<
Guid
>(
"EventId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"BizData"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Bizid"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
DateTime
>(
"CreaterDateTime"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"EventDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"EventName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"EventStaus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
?>(
"FlowRuleRuleId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"MataData"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"Type"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"EventId"
);
b
.
HasIndex
(
"FlowRuleRuleId"
);
b
.
ToTable
(
"BaseEvents"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.BaseI18N"
,
b
=>
{
b
.
Property
<
long
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bigint"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
DateTime
?>(
"AddDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
string
>(
"KeyName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ResouceDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"ResouceGroupId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
long
?>(
"ResourceId"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
string
>(
"ResourceKey"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ResourceTag"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"ResourceType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"Status"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
>(
"UserId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"ValueBG"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueCS"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueDA"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueDEDE"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueELGR"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueENGR"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueENUS"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueESES"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueFI"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueFRFR"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueHE"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueHRHR"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueHU"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueITIT"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueJAJP"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueKOKR"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueNL"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValuePLPL"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValuePT"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueSLSL"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueSR"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueSV"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueTRTR"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueUK"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueVI"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueZHCN"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ValueZHTW"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"BaseI18Ns"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.Customer"
,
b
=>
{
b
.
Property
<
Guid
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"Address"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"City"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Country"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Phone"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Province"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Street"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
?>(
"TenantId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
>(
"ZipCode"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"TenantId"
);
b
.
ToTable
(
"Customer"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DataStorage"
,
b
=>
{
b
.
Property
<
int
>(
"Catalog"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
>(
"DeviceId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"KeyName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"DataSide"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
DateTime
>(
"DateTime"
)
.
HasColumnType
(
"timestamp with time zone"
);
b
.
Property
<
int
>(
"Type"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
byte
[
]>
(
"Value_Binary"
)
.
HasColumnType
(
"bytea"
);
b
.
Property
<
bool
?>(
"Value_Boolean"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
DateTime
?>(
"Value_DateTime"
)
.
HasColumnType
(
"timestamp with time zone"
);
b
.
Property
<
double
?>(
"Value_Double"
)
.
HasColumnType
(
"double precision"
);
b
.
Property
<
string
>(
"Value_Json"
)
.
HasColumnType
(
"jsonb"
);
b
.
Property
<
long
?>(
"Value_Long"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
string
>(
"Value_String"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Value_XML"
)
.
HasColumnType
(
"xml"
);
b
.
HasKey
(
"Catalog"
,
"DeviceId"
,
"KeyName"
);
b
.
HasIndex
(
"Catalog"
);
b
.
HasIndex
(
"Catalog"
,
"DeviceId"
);
b
.
ToTable
(
"DataStorage"
);
b
.
HasDiscriminator
<
int
>(
"Catalog"
).
HasValue
(
0
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.Device"
,
b
=>
{
b
.
Property
<
Guid
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"AuthorizedKeyId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"CustomerId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
>(
"DeviceType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
DateTime
>(
"LastActive"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
bool
>(
"Online"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
Guid
?>(
"OwnerId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
>(
"Status"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
?>(
"TenantId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
>(
"Timeout"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"AuthorizedKeyId"
);
b
.
HasIndex
(
"CustomerId"
);
b
.
HasIndex
(
"OwnerId"
);
b
.
HasIndex
(
"TenantId"
);
b
.
ToTable
(
"Device"
);
b
.
HasDiscriminator
<
int
>(
"DeviceType"
).
HasValue
(
0
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DeviceDiagram"
,
b
=>
{
b
.
Property
<
Guid
>(
"DiagramId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTimeOffset
?>(
"CreateDate"
)
.
HasColumnType
(
"timestamp with time zone"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"DiagramDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DiagramImage"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DiagramName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"DiagramStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
bool
?>(
"IsDefault"
)
.
HasColumnType
(
"boolean"
);
b
.
HasKey
(
"DiagramId"
);
b
.
ToTable
(
"DeviceDiagrams"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DeviceGraph"
,
b
=>
{
b
.
Property
<
Guid
>(
"GraphId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
?>(
"CreateDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"DeviceDiagramDiagramId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
>(
"DeviceId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"GraphElementId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"GraphFill"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
decimal
?>(
"GraphHeight"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
decimal
?>(
"GraphPostionX"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
decimal
?>(
"GraphPostionY"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
string
>(
"GraphShape"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"GraphStroke"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
decimal
?>(
"GraphStrokeWidth"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
string
>(
"GraphTextAnchor"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"GraphTextFill"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"GraphTextFontFamily"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
decimal
?>(
"GraphTextFontSize"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
decimal
?>(
"GraphTextRefX"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
decimal
?>(
"GraphTextRefY"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
string
>(
"GraphTextVerticalAnchor"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
decimal
?>(
"GraphWidth"
)
.
HasColumnType
(
"numeric"
);
b
.
HasKey
(
"GraphId"
);
b
.
HasIndex
(
"DeviceDiagramDiagramId"
);
b
.
ToTable
(
"DeviceGraphs"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DeviceGraphToolBox"
,
b
=>
{
b
.
Property
<
Guid
>(
"ToolBoxId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"CommondParam"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"CommondType"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
DateTime
?>(
"CreateDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
long
?>(
"DeviceId"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
string
>(
"ToolBoxIcon"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ToolBoxName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
decimal
?>(
"ToolBoxOffsetLeftPer"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
decimal
?>(
"ToolBoxOffsetTopPer"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
decimal
?>(
"ToolBoxOffsetX"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
decimal
?>(
"ToolBoxOffsetY"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
string
>(
"ToolBoxRequestUri"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"ToolBoxStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"ToolBoxType"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"ToolBoxId"
);
b
.
ToTable
(
"DeviceGraphToolBoxes"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DeviceIdentity"
,
b
=>
{
b
.
Property
<
Guid
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"DeviceId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"IdentityId"
)
.
IsRequired
()
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"IdentityType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"IdentityValue"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"DeviceId"
);
b
.
ToTable
(
"DeviceIdentities"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DevicePort"
,
b
=>
{
b
.
Property
<
Guid
>(
"PortId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
?>(
"CreateDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
long
?>(
"Creator"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
Guid
>(
"DeviceId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"PortDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"PortElementId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"PortName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"PortPhyType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"PortPic"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"PortStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
?>(
"PortType"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"PortId"
);
b
.
ToTable
(
"DevicePorts"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DevicePortMapping"
,
b
=>
{
b
.
Property
<
Guid
>(
"MappingId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
?>(
"CreateDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
decimal
?>(
"MappingIndex"
)
.
HasColumnType
(
"numeric"
);
b
.
Property
<
int
?>(
"MappingStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
>(
"SourceDeviceId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"SourceElementId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"SourceId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"TargeId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
>(
"TargetDeviceId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"TargetElementId"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"MappingId"
);
b
.
ToTable
(
"DevicePortMappings"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DeviceRule"
,
b
=>
{
b
.
Property
<
Guid
>(
"DeviceRuleId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
>(
"ConfigDateTime"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"ConfigUser"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"DeviceId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
>(
"EnableTrace"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
?>(
"FlowRuleRuleId"
)
.
HasColumnType
(
"uuid"
);
b
.
HasKey
(
"DeviceRuleId"
);
b
.
HasIndex
(
"DeviceId"
);
b
.
HasIndex
(
"FlowRuleRuleId"
);
b
.
ToTable
(
"DeviceRules"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DynamicFormFieldInfo"
,
b
=>
{
b
.
Property
<
long
>(
"FieldId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bigint"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"FieldCode"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
DateTime
?>(
"FieldCreateDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
DateTime
?>(
"FieldEditDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
string
>(
"FieldI18nKey"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"FieldMaxLength"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"FieldName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FieldPattern"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FieldPocoTypeName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"FieldStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
long
?>(
"FieldUIElement"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
string
>(
"FieldUIElementSchema"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FieldUnit"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FieldValue"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FieldValueDataSource"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FieldValueLocalDataSource"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"FieldValueType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"FieldValueTypeName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
long
?>(
"FormId"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
bool
?>(
"IsEnabled"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
bool
?>(
"IsRequired"
)
.
HasColumnType
(
"boolean"
);
b
.
HasKey
(
"FieldId"
);
b
.
ToTable
(
"DynamicFormFieldInfos"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DynamicFormFieldValueInfo"
,
b
=>
{
b
.
Property
<
long
>(
"FieldValueId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bigint"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
long
?>(
"BizId"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"FieldCode"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
DateTime
?>(
"FieldCreateDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
long
?>(
"FieldId"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
string
>(
"FieldName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FieldUnit"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FieldValue"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
long
?>(
"FieldValueType"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
long
?>(
"FromId"
)
.
HasColumnType
(
"bigint"
);
b
.
HasKey
(
"FieldValueId"
);
b
.
ToTable
(
"DynamicFormFieldValueInfos"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.DynamicFormInfo"
,
b
=>
{
b
.
Property
<
long
>(
"FormId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bigint"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
long
?>(
"BizId"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
long
?>(
"FormCreator"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
string
>(
"FormDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FormLayout"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FormName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"FormSchame"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"FormStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
DateTime
?>(
"FromCreateDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
bool
>(
"IsCompact"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
string
>(
"ModelClass"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Url"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"FormId"
);
b
.
ToTable
(
"DynamicFormInfos"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.Flow"
,
b
=>
{
b
.
Property
<
Guid
>(
"FlowId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"Conditionexpression"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
DateTime
>(
"CreateDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"CreateId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
>(
"Createor"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"ExecutorId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"FlowRuleRuleId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
>(
"FlowStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"FlowType"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Flowdesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Flowname"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Incoming"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"NodeProcessClass"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"NodeProcessMethod"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"NodeProcessParams"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"NodeProcessScript"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"NodeProcessScriptType"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"NodeProcessType"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ObjectId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Outgoing"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"SourceId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"TargetId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"TestStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
>(
"Tester"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
>(
"TesterDateTime"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
string
>(
"bpmnid"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"FlowId"
);
b
.
HasIndex
(
"ExecutorId"
);
b
.
HasIndex
(
"FlowRuleRuleId"
);
b
.
ToTable
(
"Flows"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.FlowOperation"
,
b
=>
{
b
.
Property
<
Guid
>(
"OperationId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
?>(
"AddDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"BaseEventId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"BizId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Data"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
>(
"FlowId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
>(
"FlowRuleId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
?>(
"NodeStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"OperationDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"Step"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"Tag"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"bpmnid"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"OperationId"
);
b
.
HasIndex
(
"BaseEventId"
);
b
.
HasIndex
(
"FlowId"
);
b
.
HasIndex
(
"FlowRuleId"
);
b
.
ToTable
(
"FlowOperations"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.FlowRule"
,
b
=>
{
b
.
Property
<
Guid
>(
"RuleId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
?>(
"CreatTime"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"CreateId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"Creator"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"DefinitionsXml"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Describes"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ExecutableCode"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"MountType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
>(
"ParentRuleId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"RuleDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
?>(
"RuleStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"RuleType"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"Runner"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
double
>(
"SubVersion"
)
.
HasColumnType
(
"double precision"
);
b
.
HasKey
(
"RuleId"
);
b
.
ToTable
(
"FlowRules"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.Relationship"
,
b
=>
{
b
.
Property
<
Guid
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"CustomerId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"IdentityUserId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
?>(
"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
<
Guid
>(
"ExecutorId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
>(
"AddDateTime"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"DefaultConfig"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ExecutorDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ExecutorName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"ExecutorStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"MataData"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Path"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Tag"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"TestStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
>(
"Tester"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
>(
"TesterDateTime"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
string
>(
"TypeName"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"ExecutorId"
);
b
.
ToTable
(
"RuleTaskExecutors"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.SubscriptionEvent"
,
b
=>
{
b
.
Property
<
Guid
>(
"EventId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
DateTime
>(
"CreateDateTime"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"EventDesc"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"EventName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"EventNameSpace"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"EventParam"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"EventStatus"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"EventTag"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"Type"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"EventId"
);
b
.
ToTable
(
"SubscriptionEvents"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.SubscriptionTask"
,
b
=>
{
b
.
Property
<
Guid
>(
"BindId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
>(
"CustomerId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
>(
"EventId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"RuleTaskExecutorExecutorId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
>(
"Status"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
Guid
?>(
"SubscriptionEventId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"TaskConfig"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"BindId"
);
b
.
HasIndex
(
"CustomerId"
);
b
.
HasIndex
(
"RuleTaskExecutorExecutorId"
);
b
.
HasIndex
(
"SubscriptionEventId"
);
b
.
ToTable
(
"SubscriptionTasks"
);
});
modelBuilder
.
Entity
(
"IoTSharp.Data.TelemetryData"
,
b
=>
{
b
.
Property
<
Guid
>(
"DeviceId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"KeyName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
DateTime
>(
"DateTime"
)
.
HasColumnType
(
"timestamp with time zone"
);
b
.
Property
<
int
>(
"DataSide"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"Type"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
byte
[
]>
(
"Value_Binary"
)
.
HasColumnType
(
"bytea"
);
b
.
Property
<
bool
?>(
"Value_Boolean"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
DateTime
?>(
"Value_DateTime"
)
.
HasColumnType
(
"timestamp with time zone"
);
b
.
Property
<
double
?>(
"Value_Double"
)
.
HasColumnType
(
"double precision"
);
b
.
Property
<
string
>(
"Value_Json"
)
.
HasColumnType
(
"jsonb"
);
b
.
Property
<
long
?>(
"Value_Long"
)
.
HasColumnType
(
"bigint"
);
b
.
Property
<
string
>(
"Value_String"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"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
<
Guid
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"Address"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"City"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Country"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"EMail"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Phone"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Province"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Street"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"ZipCode"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Tenant"
);
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityRole"
,
b
=>
{
b
.
Property
<
string
>(
"Id"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ConcurrencyStamp"
)
.
IsConcurrencyToken
()
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Name"
)
.
HasMaxLength
(
256
)
.
HasColumnType
(
"character varying(256)"
);
b
.
Property
<
string
>(
"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<string>"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"ClaimType"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ClaimValue"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"RoleId"
)
.
IsRequired
()
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"RoleId"
);
b
.
ToTable
(
"AspNetRoleClaims"
);
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityUser"
,
b
=>
{
b
.
Property
<
string
>(
"Id"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"AccessFailedCount"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"ConcurrencyStamp"
)
.
IsConcurrencyToken
()
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Email"
)
.
HasMaxLength
(
256
)
.
HasColumnType
(
"character varying(256)"
);
b
.
Property
<
bool
>(
"EmailConfirmed"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
bool
>(
"LockoutEnabled"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
DateTimeOffset
?>(
"LockoutEnd"
)
.
HasColumnType
(
"timestamp with time zone"
);
b
.
Property
<
string
>(
"NormalizedEmail"
)
.
HasMaxLength
(
256
)
.
HasColumnType
(
"character varying(256)"
);
b
.
Property
<
string
>(
"NormalizedUserName"
)
.
HasMaxLength
(
256
)
.
HasColumnType
(
"character varying(256)"
);
b
.
Property
<
string
>(
"PasswordHash"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"PhoneNumber"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
bool
>(
"PhoneNumberConfirmed"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
string
>(
"SecurityStamp"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
bool
>(
"TwoFactorEnabled"
)
.
HasColumnType
(
"boolean"
);
b
.
Property
<
string
>(
"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<string>"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"ClaimType"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ClaimValue"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"UserId"
)
.
IsRequired
()
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"UserId"
);
b
.
ToTable
(
"AspNetUserClaims"
);
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityUserLogin<string>"
,
b
=>
{
b
.
Property
<
string
>(
"LoginProvider"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ProviderKey"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"ProviderDisplayName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"UserId"
)
.
IsRequired
()
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"LoginProvider"
,
"ProviderKey"
);
b
.
HasIndex
(
"UserId"
);
b
.
ToTable
(
"AspNetUserLogins"
);
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityUserRole<string>"
,
b
=>
{
b
.
Property
<
string
>(
"UserId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"RoleId"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"UserId"
,
"RoleId"
);
b
.
HasIndex
(
"RoleId"
);
b
.
ToTable
(
"AspNetUserRoles"
);
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityUserToken<string>"
,
b
=>
{
b
.
Property
<
string
>(
"UserId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"LoginProvider"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"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.DeviceGraph"
,
b
=>
{
b
.
HasOne
(
"IoTSharp.Data.DeviceDiagram"
,
"DeviceDiagram"
)
.
WithMany
()
.
HasForeignKey
(
"DeviceDiagramDiagramId"
);
b
.
Navigation
(
"DeviceDiagram"
);
});
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
(
"BaseEventId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"IoTSharp.Data.Flow"
,
"Flow"
)
.
WithMany
()
.
HasForeignKey
(
"FlowId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"IoTSharp.Data.FlowRule"
,
"FlowRule"
)
.
WithMany
()
.
HasForeignKey
(
"FlowRuleId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
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
(
"IoTSharp.Data.SubscriptionTask"
,
b
=>
{
b
.
HasOne
(
"IoTSharp.Data.Customer"
,
"Customer"
)
.
WithMany
()
.
HasForeignKey
(
"CustomerId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"IoTSharp.Data.RuleTaskExecutor"
,
"RuleTaskExecutor"
)
.
WithMany
()
.
HasForeignKey
(
"RuleTaskExecutorExecutorId"
);
b
.
HasOne
(
"IoTSharp.Data.SubscriptionEvent"
,
"Subscription"
)
.
WithMany
()
.
HasForeignKey
(
"SubscriptionEventId"
);
b
.
Navigation
(
"Customer"
);
b
.
Navigation
(
"RuleTaskExecutor"
);
b
.
Navigation
(
"Subscription"
);
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>"
,
b
=>
{
b
.
HasOne
(
"Microsoft.AspNetCore.Identity.IdentityRole"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"RoleId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityUserClaim<string>"
,
b
=>
{
b
.
HasOne
(
"Microsoft.AspNetCore.Identity.IdentityUser"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityUserLogin<string>"
,
b
=>
{
b
.
HasOne
(
"Microsoft.AspNetCore.Identity.IdentityUser"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Microsoft.AspNetCore.Identity.IdentityUserRole<string>"
,
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<string>"
,
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
}
}
}
IoTSharp.Data.PostgreSQL/Migrations/20211217110202_modyfyflowoperation.cs
0 → 100644
浏览文件 @
4650c4dd
using
System
;
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
IoTSharp.Migrations
{
public
partial
class
modyfyflowoperation
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropForeignKey
(
name
:
"FK_FlowOperations_BaseEvents_BaseEventEventId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropForeignKey
(
name
:
"FK_FlowOperations_FlowRules_FlowRuleRuleId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropForeignKey
(
name
:
"FK_FlowOperations_Flows_FlowId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropIndex
(
name
:
"IX_FlowOperations_BaseEventEventId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropIndex
(
name
:
"IX_FlowOperations_FlowRuleRuleId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropColumn
(
name
:
"BaseEventEventId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropColumn
(
name
:
"FlowRuleRuleId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
AlterColumn
<
Guid
>(
name
:
"FlowId"
,
table
:
"FlowOperations"
,
type
:
"uuid"
,
nullable
:
false
,
defaultValue
:
new
Guid
(
"00000000-0000-0000-0000-000000000000"
),
oldClrType
:
typeof
(
Guid
),
oldType
:
"uuid"
,
oldNullable
:
true
);
migrationBuilder
.
AddColumn
<
Guid
>(
name
:
"BaseEventId"
,
table
:
"FlowOperations"
,
type
:
"uuid"
,
nullable
:
false
,
defaultValue
:
new
Guid
(
"00000000-0000-0000-0000-000000000000"
));
migrationBuilder
.
AddColumn
<
Guid
>(
name
:
"FlowRuleId"
,
table
:
"FlowOperations"
,
type
:
"uuid"
,
nullable
:
false
,
defaultValue
:
new
Guid
(
"00000000-0000-0000-0000-000000000000"
));
migrationBuilder
.
CreateIndex
(
name
:
"IX_FlowOperations_BaseEventId"
,
table
:
"FlowOperations"
,
column
:
"BaseEventId"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_FlowOperations_FlowRuleId"
,
table
:
"FlowOperations"
,
column
:
"FlowRuleId"
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_FlowOperations_BaseEvents_BaseEventId"
,
table
:
"FlowOperations"
,
column
:
"BaseEventId"
,
principalTable
:
"BaseEvents"
,
principalColumn
:
"EventId"
,
onDelete
:
ReferentialAction
.
Cascade
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_FlowOperations_FlowRules_FlowRuleId"
,
table
:
"FlowOperations"
,
column
:
"FlowRuleId"
,
principalTable
:
"FlowRules"
,
principalColumn
:
"RuleId"
,
onDelete
:
ReferentialAction
.
Cascade
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_FlowOperations_Flows_FlowId"
,
table
:
"FlowOperations"
,
column
:
"FlowId"
,
principalTable
:
"Flows"
,
principalColumn
:
"FlowId"
,
onDelete
:
ReferentialAction
.
Cascade
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropForeignKey
(
name
:
"FK_FlowOperations_BaseEvents_BaseEventId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropForeignKey
(
name
:
"FK_FlowOperations_FlowRules_FlowRuleId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropForeignKey
(
name
:
"FK_FlowOperations_Flows_FlowId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropIndex
(
name
:
"IX_FlowOperations_BaseEventId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropIndex
(
name
:
"IX_FlowOperations_FlowRuleId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropColumn
(
name
:
"BaseEventId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
DropColumn
(
name
:
"FlowRuleId"
,
table
:
"FlowOperations"
);
migrationBuilder
.
AlterColumn
<
Guid
>(
name
:
"FlowId"
,
table
:
"FlowOperations"
,
type
:
"uuid"
,
nullable
:
true
,
oldClrType
:
typeof
(
Guid
),
oldType
:
"uuid"
);
migrationBuilder
.
AddColumn
<
Guid
>(
name
:
"BaseEventEventId"
,
table
:
"FlowOperations"
,
type
:
"uuid"
,
nullable
:
true
);
migrationBuilder
.
AddColumn
<
Guid
>(
name
:
"FlowRuleRuleId"
,
table
:
"FlowOperations"
,
type
:
"uuid"
,
nullable
:
true
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_FlowOperations_BaseEventEventId"
,
table
:
"FlowOperations"
,
column
:
"BaseEventEventId"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_FlowOperations_FlowRuleRuleId"
,
table
:
"FlowOperations"
,
column
:
"FlowRuleRuleId"
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_FlowOperations_BaseEvents_BaseEventEventId"
,
table
:
"FlowOperations"
,
column
:
"BaseEventEventId"
,
principalTable
:
"BaseEvents"
,
principalColumn
:
"EventId"
,
onDelete
:
ReferentialAction
.
Restrict
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_FlowOperations_FlowRules_FlowRuleRuleId"
,
table
:
"FlowOperations"
,
column
:
"FlowRuleRuleId"
,
principalTable
:
"FlowRules"
,
principalColumn
:
"RuleId"
,
onDelete
:
ReferentialAction
.
Restrict
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_FlowOperations_Flows_FlowId"
,
table
:
"FlowOperations"
,
column
:
"FlowId"
,
principalTable
:
"Flows"
,
principalColumn
:
"FlowId"
,
onDelete
:
ReferentialAction
.
Restrict
);
}
}
}
IoTSharp.Data.PostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs
浏览文件 @
4650c4dd
...
...
@@ -1050,7 +1050,7 @@ namespace IoTSharp.Migrations
b
.
Property
<
DateTime
?>(
"AddDate"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
Guid
?>(
"BaseEvent
EventId"
)
b
.
Property
<
Guid
>(
"Base
EventId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"BizId"
)
...
...
@@ -1059,10 +1059,10 @@ namespace IoTSharp.Migrations
b
.
Property
<
string
>(
"Data"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
?
>(
"FlowId"
)
b
.
Property
<
Guid
>(
"FlowId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
?>(
"FlowRule
RuleId"
)
b
.
Property
<
Guid
>(
"Flow
RuleId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
?>(
"NodeStatus"
)
...
...
@@ -1082,11 +1082,11 @@ namespace IoTSharp.Migrations
b
.
HasKey
(
"OperationId"
);
b
.
HasIndex
(
"BaseEvent
Event
Id"
);
b
.
HasIndex
(
"BaseEventId"
);
b
.
HasIndex
(
"FlowId"
);
b
.
HasIndex
(
"FlowRule
Rule
Id"
);
b
.
HasIndex
(
"FlowRuleId"
);
b
.
ToTable
(
"FlowOperations"
);
});
...
...
@@ -1724,15 +1724,21 @@ namespace IoTSharp.Migrations
{
b
.
HasOne
(
"IoTSharp.Data.BaseEvent"
,
"BaseEvent"
)
.
WithMany
()
.
HasForeignKey
(
"BaseEventEventId"
);
.
HasForeignKey
(
"BaseEventId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"IoTSharp.Data.Flow"
,
"Flow"
)
.
WithMany
()
.
HasForeignKey
(
"FlowId"
);
.
HasForeignKey
(
"FlowId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"IoTSharp.Data.FlowRule"
,
"FlowRule"
)
.
WithMany
()
.
HasForeignKey
(
"FlowRuleRuleId"
);
.
HasForeignKey
(
"FlowRuleId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
Navigation
(
"BaseEvent"
);
...
...
IoTSharp.Data/FlowOperation.cs
浏览文件 @
4650c4dd
...
...
@@ -23,11 +23,11 @@ namespace IoTSharp.Data
public
string
BizId
{
get
;
set
;
}
public
string
bpmnid
{
get
;
set
;
}
public
Flow
Flow
{
get
;
set
;
}
public
Guid
FlowId
{
get
;
set
;
}
public
FlowRule
FlowRule
{
get
;
set
;
}
public
Guid
FlowRuleId
{
get
;
set
;
}
public
BaseEvent
BaseEvent
{
get
;
set
;
}
public
Guid
BaseEventId
{
get
;
set
;
}
public
int
Step
{
get
;
set
;
}
public
string
Tag
{
get
;
set
;
}
}
...
...
IoTSharp/ClientApp/src/app/routes/device/devicelist/devicelist.component.ts
浏览文件 @
4650c4dd
...
...
@@ -97,7 +97,7 @@ export class DevicelistComponent implements OnInit, OnDestroy {
{
title
:
'
名称
'
,
index
:
'
name
'
,
render
:
'
name
'
},
{
title
:
'
设备类型
'
,
index
:
'
deviceType
'
,
type
:
'
tag
'
,
tag
:
this
.
DeviceTAG
},
{
title
:
'
在线状态
'
,
index
:
'
online
'
,
type
:
'
badge
'
,
badge
:
this
.
BADGE
},
{
title
:
'
最后活动时间
'
,
index
:
'
lastActive
'
},
{
title
:
'
最后活动时间
'
,
index
:
'
lastActive
'
,
type
:
'
date
'
},
{
title
:
'
认证方式
'
,
index
:
'
identityType
'
,
type
:
'
tag
'
,
tag
:
this
.
TAG
},
{
title
:
'
操作
'
,
...
...
IoTSharp/ClientApp/src/app/routes/flow/diagram/diagram.component.html
浏览文件 @
4650c4dd
...
...
@@ -80,10 +80,7 @@
<nz-option
nzValue=
"sql"
nzLabel=
"sql"
></nz-option>
<nz-option
nzValue=
"lua"
nzLabel=
"lua"
></nz-option>
<nz-option
nzValue=
"csharp"
nzLabel=
"csharp"
></nz-option>
<nz-option
nzValue=
"json"
nzLabel=
"json"
[nzDisabled]=
"true"
></nz-option>
<nz-option
nzValue=
"bat"
nzLabel=
"bat"
[nzDisabled]=
"true"
></nz-option>
<nz-option
nzValue=
"xml"
nzLabel=
"xml"
[nzDisabled]=
"true"
></nz-option>
</nz-select>
</se>
<se
label=
"执行器"
error=
"请选择执行器"
*ngIf=
"form.nodeProcessClassVisable"
>
...
...
IoTSharp/ClientApp/src/app/routes/flow/floweventview/floweventview.component.ts
浏览文件 @
4650c4dd
...
...
@@ -36,7 +36,7 @@ export class FloweventviewComponent implements OnInit, OnDestroy {
this
.
flowview
.
diagramdata
=
x
.
data
;
this
.
flowview
.
loadXml
();
}),
),
this
.
http
.
get
(
'
api/rules/
getFlowOpers
tions?eventId=
'
+
this
.
event
.
eventId
).
pipe
(
),
this
.
http
.
get
(
'
api/rules/
GetFlowOpera
tions?eventId=
'
+
this
.
event
.
eventId
).
pipe
(
map
((
x
)
=>
{
if
(
x
.
data
.
length
>
0
){
...
...
IoTSharp/Controllers/RulesController.cs
浏览文件 @
4650c4dd
...
...
@@ -1069,22 +1069,30 @@ namespace IoTSharp.Controllers
var
d
=
formdata
.
Value
<
JToken
>().
ToObject
(
typeof
(
ExpandoObject
));
var
testabizId
=
Guid
.
NewGuid
().
ToString
();
//根据业务保存起来,用来查询执行事件和步骤
var
result
=
await
_flowRuleProcessor
.
RunFlowRules
(
ruleid
,
d
,
Guid
.
Empty
,
EventType
.
TestPurpose
,
testabizId
);
if
(
result
.
Count
>
0
)
{
result
.
ForEach
(
c
=>
{
_context
.
FlowOperations
.
Add
(
new
FlowOperation
()
{
AddDate
=
c
.
AddDate
,
BaseEventId
=
c
.
BaseEventId
,
BizId
=
c
.
BizId
,
Data
=
c
.
Data
,
FlowId
=
c
.
FlowId
,
FlowRuleId
=
c
.
FlowRuleId
,
NodeStatus
=
c
.
NodeStatus
,
OperationDesc
=
c
.
OperationDesc
,
OperationId
=
new
Guid
(),
Step
=
c
.
Step
,
Tag
=
c
.
Tag
,
bpmnid
=
c
.
bpmnid
});
_context
.
SaveChanges
();
});
//result.ForEach(c =>
//{
// _context.FlowOperations.Add(new FlowOperation()
// {
// AddDate = c.AddDate, BaseEvent = c.BaseEvent, BizId = c.BizId, Data = c.Data, Flow = c.Flow, FlowRule = c.FlowRule, NodeStatus = c.NodeStatus, OperationDesc = c.OperationDesc, OperationId = c.OperationId, Step = c.Step, Tag = c.Tag, bpmnid = c.bpmnid
// });
// _context.SaveChanges();
//});
}
return
new
ApiResult
<
dynamic
>(
ApiCode
.
Success
,
"test complete"
,
result
.
OrderBy
(
c
=>
c
.
Step
).
Where
(
c
=>
c
.
BaseEvent
.
Bizid
==
testabizId
).
ToList
()
.
GroupBy
(
c
=>
c
.
Step
).
Select
(
c
=>
new
...
...
@@ -1174,9 +1182,9 @@ namespace IoTSharp.Controllers
[
HttpGet
(
"[action]"
)]
public
ApiResult
<
dynamic
>
GetFlowOper
s
tions
(
Guid
eventId
)
public
ApiResult
<
dynamic
>
GetFlowOper
a
tions
(
Guid
eventId
)
{
return
new
ApiResult
<
dynamic
>(
ApiCode
.
Success
,
"OK"
,
_context
.
FlowOperations
.
Where
(
c
=>
c
.
BaseEvent
.
Event
Id
==
eventId
).
ToList
().
OrderBy
(
c
=>
c
.
Step
).
return
new
ApiResult
<
dynamic
>(
ApiCode
.
Success
,
"OK"
,
_context
.
FlowOperations
.
Where
(
c
=>
c
.
BaseEventId
==
eventId
).
ToList
().
OrderBy
(
c
=>
c
.
Step
).
ToList
()
.
GroupBy
(
c
=>
c
.
Step
).
Select
(
c
=>
new
{
...
...
@@ -1321,10 +1329,6 @@ namespace IoTSharp.Controllers
var
data
=
JsonConvert
.
DeserializeObject
(
m
.
Data
)
as
JObject
;
var
d
=
data
.
ToObject
(
typeof
(
ExpandoObject
));
var
result
=
await
this
.
_flowRuleProcessor
.
TestCondition
(
m
.
ruleId
,
m
.
flowId
,
d
);
return
new
ApiResult
<
ConditionTestResult
>(
ApiCode
.
Success
,
"Ok"
,
result
);
}
...
...
IoTSharp/Dtos/FlowOperationDto.cs
0 → 100644
浏览文件 @
4650c4dd
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
IoTSharp.Dtos
{
public
class
FlowOperationDto
{
public
Guid
OperationId
{
get
;
set
;
}
public
DateTime
?
AddDate
{
get
;
set
;
}
/// <summary>
/// 节点处理状态,0 创建完
/// </summary>
public
int
?
NodeStatus
{
get
;
set
;
}
public
string
OperationDesc
{
get
;
set
;
}
public
string
Data
{
get
;
set
;
}
public
string
BizId
{
get
;
set
;
}
public
string
bpmnid
{
get
;
set
;
}
public
Guid
ruleid
{
get
;
set
;
}
public
Guid
flowid
{
get
;
set
;
}
public
Guid
eventid
{
get
;
set
;
}
public
int
Step
{
get
;
set
;
}
}
}
IoTSharp/FlowRuleEngine/FlowRuleProcessor.cs
浏览文件 @
4650c4dd
...
...
@@ -117,7 +117,11 @@ namespace IoTSharp.FlowRuleEngine
bpmnid
=
""
,
AddDate
=
DateTime
.
Now
,
FlowRule
=
rule
,
FlowRuleId
=
rule
.
RuleId
,
BaseEventId
=
@event
.
EventId
,
FlowId
=
start
.
FlowId
,
Flow
=
start
,
Data
=
JsonConvert
.
SerializeObject
(
data
),
NodeStatus
=
1
,
OperationDesc
=
"未能找到启动节点"
,
...
...
@@ -137,6 +141,9 @@ namespace IoTSharp.FlowRuleEngine
AddDate
=
DateTime
.
Now
,
FlowRule
=
rule
,
Flow
=
start
,
FlowRuleId
=
rule
.
RuleId
,
BaseEventId
=
@event
.
EventId
,
FlowId
=
start
.
FlowId
,
Data
=
JsonConvert
.
SerializeObject
(
data
),
NodeStatus
=
1
,
OperationDesc
=
"进入开始节点"
,
...
...
@@ -157,6 +164,12 @@ namespace IoTSharp.FlowRuleEngine
AddDate
=
DateTime
.
Now
,
FlowRule
=
@event
.
FlowRule
,
Flow
=
item
,
FlowRuleId
=
rule
.
RuleId
,
BaseEventId
=
@event
.
EventId
,
FlowId
=
start
.
FlowId
,
Data
=
JsonConvert
.
SerializeObject
(
data
),
NodeStatus
=
1
,
OperationDesc
=
"Condition("
+
(
string
.
IsNullOrEmpty
(
item
.
Conditionexpression
)
...
...
@@ -204,6 +217,11 @@ namespace IoTSharp.FlowRuleEngine
AddDate
=
DateTime
.
Now
,
FlowRule
=
peroperation
.
BaseEvent
.
FlowRule
,
Flow
=
flow
,
FlowRuleId
=
peroperation
.
BaseEvent
.
FlowRule
.
RuleId
,
BaseEventId
=
peroperation
.
BaseEvent
.
EventId
,
FlowId
=
flow
.
FlowId
,
Data
=
JsonConvert
.
SerializeObject
(
data
),
NodeStatus
=
1
,
OperationDesc
=
"Condition("
+
(
string
.
IsNullOrEmpty
(
flow
.
Conditionexpression
)
...
...
@@ -227,6 +245,9 @@ namespace IoTSharp.FlowRuleEngine
AddDate
=
DateTime
.
Now
,
FlowRule
=
peroperation
.
BaseEvent
.
FlowRule
,
Flow
=
flow
,
FlowRuleId
=
peroperation
.
BaseEvent
.
FlowRule
.
RuleId
,
BaseEventId
=
peroperation
.
BaseEvent
.
EventId
,
FlowId
=
flow
.
FlowId
,
Data
=
JsonConvert
.
SerializeObject
(
data
),
NodeStatus
=
1
,
OperationDesc
=
"Run"
+
flow
.
NodeProcessScriptType
+
"Task:"
+
flow
.
Flowname
,
...
...
@@ -355,6 +376,9 @@ namespace IoTSharp.FlowRuleEngine
AddDate
=
DateTime
.
Now
,
FlowRule
=
peroperation
.
BaseEvent
.
FlowRule
,
Flow
=
item
,
FlowRuleId
=
peroperation
.
BaseEvent
.
FlowRule
.
RuleId
,
BaseEventId
=
peroperation
.
BaseEvent
.
EventId
,
FlowId
=
item
.
FlowId
,
Data
=
JsonConvert
.
SerializeObject
(
obj
),
NodeStatus
=
1
,
OperationDesc
=
"Execute("
+
...
...
@@ -387,6 +411,9 @@ namespace IoTSharp.FlowRuleEngine
AddDate
=
DateTime
.
Now
,
FlowRule
=
peroperation
.
BaseEvent
.
FlowRule
,
Flow
=
item
,
FlowRuleId
=
peroperation
.
BaseEvent
.
FlowRule
.
RuleId
,
BaseEventId
=
peroperation
.
BaseEvent
.
EventId
,
FlowId
=
item
.
FlowId
,
Data
=
JsonConvert
.
SerializeObject
(
data
),
NodeStatus
=
1
,
OperationDesc
=
"执行条件("
+
(
string
.
IsNullOrEmpty
(
item
.
Conditionexpression
)
...
...
@@ -411,10 +438,16 @@ namespace IoTSharp.FlowRuleEngine
if
(
end
!=
null
)
{
end
.
FlowRuleId
=
peroperation
.
BaseEvent
.
FlowRule
.
RuleId
;
end
.
BaseEventId
=
peroperation
.
BaseEvent
.
EventId
;
end
.
FlowId
=
flow
.
FlowId
;
end
.
bpmnid
=
flow
.
bpmnid
;
end
.
AddDate
=
DateTime
.
Now
;
end
.
FlowRule
=
peroperation
.
BaseEvent
.
FlowRule
;
end
.
Flow
=
flow
;
end
.
Data
=
JsonConvert
.
SerializeObject
(
data
);
end
.
NodeStatus
=
1
;
end
.
OperationDesc
=
"处理完成"
;
...
...
@@ -424,6 +457,10 @@ namespace IoTSharp.FlowRuleEngine
else
{
end
=
new
FlowOperation
();
end
.
FlowRuleId
=
peroperation
.
BaseEvent
.
FlowRule
.
RuleId
;
end
.
BaseEventId
=
peroperation
.
BaseEvent
.
EventId
;
end
.
FlowId
=
flow
.
FlowId
;
end
.
OperationId
=
Guid
.
NewGuid
();
end
.
bpmnid
=
flow
.
bpmnid
;
end
.
AddDate
=
DateTime
.
Now
;
...
...
IoTSharp/IoTSharp.xml
浏览文件 @
4650c4dd
...
...
@@ -579,6 +579,11 @@
客户
</summary>
</member>
<member
name=
"P:IoTSharp.Dtos.FlowOperationDto.NodeStatus"
>
<summary>
节点处理状态,0 创建完
</summary>
</member>
<member
name=
"P:IoTSharp.Dtos.InstallDto.Email"
>
<summary>
系统管理员用户名
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录