Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
IoTSharp
IoTSharp
提交
02f550ca
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 搜索 >>
提交
02f550ca
编写于
11月 11, 2021
作者:
W
wq1234wq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
事件列表修改
上级
86201049
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
25 deletion
+41
-25
IoTSharp.TaskAction/MessagePullExcutor.cs
IoTSharp.TaskAction/MessagePullExcutor.cs
+31
-20
IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.html
.../src/app/routes/flow/flowevents/flowevents.component.html
+9
-3
IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.ts
...pp/src/app/routes/flow/flowevents/flowevents.component.ts
+0
-1
IoTSharp/Controllers/HomeController.cs
IoTSharp/Controllers/HomeController.cs
+1
-1
未找到文件。
IoTSharp.TaskAction/MessagePullExcutor.cs
浏览文件 @
02f550ca
...
...
@@ -52,36 +52,47 @@ namespace IoTSharp.TaskAction
private
TaskActionOutput
SendData
(
TaskActionInput
input
)
{
JObject
o
=
JsonConvert
.
DeserializeObject
(
input
.
Input
)
as
JObject
;
var
config
=
JsonConvert
.
DeserializeObject
<
ModelExecutorConfig
>(
input
.
ExecutorConfig
);
var
dd
=
o
.
Properties
().
Select
(
c
=>
new
ParamObject
{
keyName
=
c
.
Name
,
value
=
JPropertyToObject
(
c
)
}).
ToList
();
string
contentType
=
"application/json"
;
var
restclient
=
new
RestClient
(
config
.
BaseUrl
);
var
request
=
new
RestRequest
(
config
.
Url
+(
input
.
DeviceId
==
Guid
.
Empty
?
""
:
"/"
+
input
.
DeviceId
),
Method
.
POST
);
request
.
AddHeader
(
"X-Access-Token"
,
config
.
Token
);
request
.
RequestFormat
=
DataFormat
.
Json
;
request
.
AddHeader
(
"cache-control"
,
"no-cache"
);
request
.
AddJsonBody
(
JsonConvert
.
SerializeObject
(
dd
));
var
response
=
restclient
.
Execute
(
request
);
if
(
response
.
StatusCode
==
HttpStatusCode
.
OK
)
try
{
var
result
=
JsonConvert
.
DeserializeObject
<
MessagePullResult
>(
response
.
Content
);
if
(
result
!=
null
&&
result
.
success
)
JObject
o
=
JsonConvert
.
DeserializeObject
(
input
.
Input
)
as
JObject
;
var
config
=
JsonConvert
.
DeserializeObject
<
ModelExecutorConfig
>(
input
.
ExecutorConfig
);
var
dd
=
o
.
Properties
().
Select
(
c
=>
new
ParamObject
{
keyName
=
c
.
Name
,
value
=
JPropertyToObject
(
c
)
}).
ToList
();
string
contentType
=
"application/json"
;
var
restclient
=
new
RestClient
(
config
.
BaseUrl
);
var
request
=
new
RestRequest
(
config
.
Url
+
(
input
.
DeviceId
==
Guid
.
Empty
?
""
:
"/"
+
input
.
DeviceId
),
Method
.
POST
);
request
.
AddHeader
(
"X-Access-Token"
,
config
.
Token
);
request
.
RequestFormat
=
DataFormat
.
Json
;
request
.
AddHeader
(
"cache-control"
,
"no-cache"
);
request
.
AddJsonBody
(
JsonConvert
.
SerializeObject
(
dd
));
var
response
=
restclient
.
Execute
(
request
);
if
(
response
.
StatusCode
==
HttpStatusCode
.
OK
)
{
return
new
TaskActionOutput
()
{
ExecutionInfo
=
result
.
message
,
ExecutionStatus
=
result
.
success
,
DynamicOutput
=
input
.
DynamicInput
};
;
var
result
=
JsonConvert
.
DeserializeObject
<
MessagePullResult
>(
response
.
Content
);
if
(
result
!=
null
&&
result
.
success
)
{
return
new
TaskActionOutput
()
{
ExecutionInfo
=
result
.
message
,
ExecutionStatus
=
result
.
success
,
DynamicOutput
=
input
.
DynamicInput
};
;
}
else
{
return
new
TaskActionOutput
()
{
ExecutionInfo
=
result
.
message
,
ExecutionStatus
=
result
.
success
};
;
}
}
else
{
return
new
TaskActionOutput
()
{
ExecutionInfo
=
res
ult
.
message
,
ExecutionStatus
=
result
.
success
};
;
return
new
TaskActionOutput
()
{
ExecutionInfo
=
res
ponse
.
ErrorMessage
,
ExecutionStatus
=
false
};
;
}
}
else
catch
(
Exception
ex
)
{
return
new
TaskActionOutput
()
{
ExecutionInfo
=
response
.
ErrorMessage
,
ExecutionStatus
=
false
};
;
return
new
TaskActionOutput
()
{
ExecutionInfo
=
ex
.
Message
,
ExecutionStatus
=
false
};
;
}
}
...
...
IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.html
浏览文件 @
02f550ca
...
...
@@ -61,9 +61,15 @@
</nz-dropdown-menu>
</ng-container>
<st
#st
[columns]=
"columns"
[data]=
"url"
ps=
"10"
[page]=
"page"
[req]=
"req"
[res]=
"res"
>
<ng-template
st-row=
"rulestatus"
let-i
>
<nz-badge
[nzStatus]=
"i.statusType"
[nzText]=
"i.statusText"
></nz-badge>
<st
#st
[columns]=
"columns"
[data]=
"url"
ps=
"10"
[page]=
"page"
[req]=
"req"
[res]=
"res"
[expand]=
"expand"
expandAccordion
>
<ng-template
#expand
let-item
let-index=
"index"
let-column=
"column"
>
<nz-card
nzTitle=
"描述"
>
{{ item.eventDesc }}
</nz-card>
<nz-card
nzTitle=
"输入值"
>
{{ item.mataData }}
</nz-card>
</ng-template>
</st>
</nz-card>
...
...
IoTSharp/ClientApp/src/app/routes/flow/flowevents/flowevents.component.ts
浏览文件 @
02f550ca
...
...
@@ -59,7 +59,6 @@ export class FloweventsComponent implements OnInit {
columns
:
STColumn
[]
=
[
{
title
:
''
,
index
:
'
eventId
'
,
type
:
'
checkbox
'
},
{
title
:
'
事件名称
'
,
index
:
'
eventName
'
,
render
:
'
name
'
},
{
title
:
'
备注
'
,
index
:
'
eventDesc
'
},
{
title
:
'
类型
'
,
index
:
'
type
'
,
type
:
'
tag
'
,
tag
:
this
.
TAG
},
{
title
:
'
触发规则
'
,
index
:
'
name
'
},
{
title
:
'
事件源
'
,
index
:
'
creatorName
'
},
...
...
IoTSharp/Controllers/HomeController.cs
浏览文件 @
02f550ca
...
...
@@ -14,7 +14,7 @@ namespace IoTSharp.Controllers
[
ApiController
]
public
class
HomeController
:
ControllerBase
{
public
new
ApiResult
<
HomeDto
>
Index
()
public
ApiResult
<
HomeDto
>
Index
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录