Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
IoTSharp
IoTSharp
提交
5f02f9d2
IoTSharp
项目概览
IoTSharp
/
IoTSharp
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
5f02f9d2
编写于
2月 12, 2022
作者:
麦壳饼
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修正事件 ID等问题
上级
2600373f
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
2442 addition
and
14 deletion
+2442
-14
IoTSharp.Data.PostgreSQL/Migrations/20220212023819_FixIX_TelemetryData_DeviceId_KeyName_DateTime.Designer.cs
...FixIX_TelemetryData_DeviceId_KeyName_DateTime.Designer.cs
+2336
-0
IoTSharp.Data.PostgreSQL/Migrations/20220212023819_FixIX_TelemetryData_DeviceId_KeyName_DateTime.cs
...12023819_FixIX_TelemetryData_DeviceId_KeyName_DateTime.cs
+98
-0
IoTSharp.Data.PostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs
...ostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs
+4
-8
IoTSharp.Data/BaseEvent.cs
IoTSharp.Data/BaseEvent.cs
+1
-3
IoTSharp/Controllers/RulesController.cs
IoTSharp/Controllers/RulesController.cs
+1
-1
IoTSharp/appsettings.PostgreSql.json
IoTSharp/appsettings.PostgreSql.json
+2
-2
未找到文件。
IoTSharp.Data.PostgreSQL/Migrations/20220212023819_FixIX_TelemetryData_DeviceId_KeyName_DateTime.Designer.cs
0 → 100644
浏览文件 @
5f02f9d2
此差异已折叠。
点击以展开。
IoTSharp.Data.PostgreSQL/Migrations/20220212023819_FixIX_TelemetryData_DeviceId_KeyName_DateTime.cs
0 → 100644
浏览文件 @
5f02f9d2
using
System
;
using
Microsoft.EntityFrameworkCore.Migrations
;
#
nullable
disable
namespace
IoTSharp.Migrations
{
public
partial
class
FixIX_TelemetryData_DeviceId_KeyName_DateTime
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropForeignKey
(
name
:
"FK_BaseEvents_Customer_CustomerId"
,
table
:
"BaseEvents"
);
migrationBuilder
.
DropForeignKey
(
name
:
"FK_BaseEvents_Tenant_TenantId"
,
table
:
"BaseEvents"
);
migrationBuilder
.
AlterColumn
<
Guid
>(
name
:
"TenantId"
,
table
:
"BaseEvents"
,
type
:
"uuid"
,
nullable
:
true
,
oldClrType
:
typeof
(
Guid
),
oldType
:
"uuid"
);
migrationBuilder
.
AlterColumn
<
Guid
>(
name
:
"CustomerId"
,
table
:
"BaseEvents"
,
type
:
"uuid"
,
nullable
:
true
,
oldClrType
:
typeof
(
Guid
),
oldType
:
"uuid"
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_BaseEvents_Customer_CustomerId"
,
table
:
"BaseEvents"
,
column
:
"CustomerId"
,
principalTable
:
"Customer"
,
principalColumn
:
"Id"
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_BaseEvents_Tenant_TenantId"
,
table
:
"BaseEvents"
,
column
:
"TenantId"
,
principalTable
:
"Tenant"
,
principalColumn
:
"Id"
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropForeignKey
(
name
:
"FK_BaseEvents_Customer_CustomerId"
,
table
:
"BaseEvents"
);
migrationBuilder
.
DropForeignKey
(
name
:
"FK_BaseEvents_Tenant_TenantId"
,
table
:
"BaseEvents"
);
migrationBuilder
.
AlterColumn
<
Guid
>(
name
:
"TenantId"
,
table
:
"BaseEvents"
,
type
:
"uuid"
,
nullable
:
false
,
defaultValue
:
new
Guid
(
"00000000-0000-0000-0000-000000000000"
),
oldClrType
:
typeof
(
Guid
),
oldType
:
"uuid"
,
oldNullable
:
true
);
migrationBuilder
.
AlterColumn
<
Guid
>(
name
:
"CustomerId"
,
table
:
"BaseEvents"
,
type
:
"uuid"
,
nullable
:
false
,
defaultValue
:
new
Guid
(
"00000000-0000-0000-0000-000000000000"
),
oldClrType
:
typeof
(
Guid
),
oldType
:
"uuid"
,
oldNullable
:
true
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_BaseEvents_Customer_CustomerId"
,
table
:
"BaseEvents"
,
column
:
"CustomerId"
,
principalTable
:
"Customer"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Cascade
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_BaseEvents_Tenant_TenantId"
,
table
:
"BaseEvents"
,
column
:
"TenantId"
,
principalTable
:
"Tenant"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Cascade
);
}
}
}
IoTSharp.Data.PostgreSQL/Migrations/ApplicationDbContextModelSnapshot.cs
浏览文件 @
5f02f9d2
...
...
@@ -198,7 +198,7 @@ namespace IoTSharp.Migrations
b
.
Property
<
Guid
>(
"Creator"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
Guid
>(
"CustomerId"
)
b
.
Property
<
Guid
?
>(
"CustomerId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
string
>(
"EventDesc"
)
...
...
@@ -216,7 +216,7 @@ namespace IoTSharp.Migrations
b
.
Property
<
string
>(
"MataData"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
Guid
>(
"TenantId"
)
b
.
Property
<
Guid
?
>(
"TenantId"
)
.
HasColumnType
(
"uuid"
);
b
.
Property
<
int
>(
"Type"
)
...
...
@@ -1872,9 +1872,7 @@ namespace IoTSharp.Migrations
{
b
.
HasOne
(
"IoTSharp.Data.Customer"
,
"Customer"
)
.
WithMany
()
.
HasForeignKey
(
"CustomerId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
.
HasForeignKey
(
"CustomerId"
);
b
.
HasOne
(
"IoTSharp.Data.FlowRule"
,
"FlowRule"
)
.
WithMany
()
...
...
@@ -1882,9 +1880,7 @@ namespace IoTSharp.Migrations
b
.
HasOne
(
"IoTSharp.Data.Tenant"
,
"Tenant"
)
.
WithMany
()
.
HasForeignKey
(
"TenantId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
.
HasForeignKey
(
"TenantId"
);
b
.
Navigation
(
"Customer"
);
...
...
IoTSharp.Data/BaseEvent.cs
浏览文件 @
5f02f9d2
...
...
@@ -25,9 +25,7 @@ namespace IoTSharp.Data
public
string
BizData
{
get
;
set
;
}
public
Tenant
Tenant
{
get
;
set
;
}
public
Guid
TenantId
{
get
;
set
;
}
public
Guid
CustomerId
{
get
;
set
;
}
public
Customer
Customer
{
get
;
set
;
}
...
...
IoTSharp/Controllers/RulesController.cs
浏览文件 @
5f02f9d2
...
...
@@ -1171,7 +1171,7 @@ namespace IoTSharp.Controllers
public
async
Task
<
ApiResult
<
PagedData
<
BaseEventDto
>>>
FlowEvents
([
FromBody
]
EventParam
m
)
{
var
profile
=
await
this
.
GetUserProfile
();
Expression
<
Func
<
BaseEvent
,
bool
>>
condition
=
x
=>
x
.
EventStaus
>
-
1
&&
x
.
TenantId
==
profile
.
Tenant
;
Expression
<
Func
<
BaseEvent
,
bool
>>
condition
=
x
=>
x
.
EventStaus
>
-
1
&&
x
.
Tenant
.
Id
==
profile
.
Tenant
;
if
(!
string
.
IsNullOrEmpty
(
m
.
Name
))
{
condition
=
condition
.
And
(
x
=>
x
.
EventName
.
Contains
(
m
.
Name
));
...
...
IoTSharp/appsettings.PostgreSql.json
浏览文件 @
5f02f9d2
...
...
@@ -8,8 +8,8 @@
},
"DataBase"
:
"PostgreSql"
,
"ConnectionStrings"
:
{
"IoTSharp"
:
"Server=localhost;Database=IoTSharp;Username=postgres;Password=future;"
,
"TelemetryStorage"
:
"Server=localhost;Database=IoTSharp;Username=postgres;Password=future;"
"IoTSharp"
:
"Server=localhost;Database=IoTSharp
100
;Username=postgres;Password=future;"
,
"TelemetryStorage"
:
"Server=localhost;Database=IoTSharp
100
;Username=postgres;Password=future;"
},
"JwtKey"
:
"iotsharpiotsharpiotsharpiotsharpiotsharp"
,
"JwtExpireHours"
:
3
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录