From 157be5220d9d81bce18e8248ef6ac056415405a1 Mon Sep 17 00:00:00 2001
From: Tong <1025782220@qq.com>
Date: 星期二, 31 八月 2021 09:29:45 +0800
Subject: [PATCH] 更新推送库
---
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
index 65ad0e0..193f4c7 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -37,7 +37,7 @@
/// <returns></returns>
public static ResponsePackNew GetLogicIdList()
{
- var jObject = new JObject { { "homeId", LogicMethod.HomeId } };
+ var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId } };
var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_List);
//濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken
if (responsePackNew.Code == StateCode.TOKEN_EXPIRED)
@@ -114,6 +114,7 @@
{
var outputTypeJOb = new JObject { };
outputTypeJOb.Add("sid", dictionary.sid);
+ outputTypeJOb.Add("delay", dictionary.delay);
outputTypeJOb.Add("target_type", dictionary.target_type);
var statusArray = new JArray { };
foreach (var dic in dictionary.status)
@@ -153,7 +154,7 @@
var logicjArray = new JArray { };
var logicIfon = new JObject { };
logicIfon.Add("sid", logic.sid);
- logicIfon.Add("gatewayId", LogicMethod.GatewayId);
+ logicIfon.Add("gatewayId", LogicMethod.CurrLogicMethod.GatewayId);
logicIfon.Add("name", logic.name);
logicIfon.Add("relation", logic.relation);
logicIfon.Add("enable", logic.enable);
@@ -163,15 +164,14 @@
logicIfon.Add("noticeConfig", noticeConfigJObject);
logicIfon.Add("pushConfigs", pushConfigsArray);
logicjArray.Add(logicIfon);
- var jObject = new JObject { { "homeId", LogicMethod.HomeId }, { "logics", logicjArray } };
- responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add);
+ var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } };
+ responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add,5);
//濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken
if (responsePackNew.Code == StateCode.TOKEN_EXPIRED)
{
RefreshToken();
AddLogic(logic);
}
- Console.WriteLine("娣诲姞閫昏緫===" + logicjArray);
}
catch (Exception e)
{
@@ -210,7 +210,10 @@
{
var conditionJOb = new JObject { };
conditionJOb.Add("key", dic["key"]);
- conditionJOb.Add("comparator", dic["comparator"]);
+ var c1 = "";
+ dic.TryGetValue("comparator", out c1);
+ c1 = string.IsNullOrEmpty(c1) ? "" : c1;
+ conditionJOb.TryAdd("comparator", c1);
conditionJOb.Add("data_type", dic["data_type"]);
conditionJOb.Add("value", dic["value"]);
conditionArray.Add(conditionJOb);
@@ -224,6 +227,7 @@
{
var outputTypeJOb = new JObject { };
outputTypeJOb.Add("sid", dictionary.sid);
+ outputTypeJOb.Add("delay", dictionary.delay);
outputTypeJOb.Add("target_type", dictionary.target_type);
var statusArray = new JArray { };
foreach (var dic in dictionary.status)
@@ -243,7 +247,8 @@
var pushConfigsArray = new JArray { };
if (logic.pushConfigs.Count > 0)
- { //聽鎺ㄩ�佹枃鏈�
+ {
+ //聽鎺ㄩ�佹枃鏈�
foreach (var pushConfig in logic.pushConfigs)
{
@@ -263,7 +268,7 @@
var logicIfon = new JObject { };
logicIfon.Add("userLogicId", logic.userLogicId);
logicIfon.Add("sid", logic.sid);
- logicIfon.Add("gatewayId", LogicMethod.GatewayId);
+ logicIfon.Add("gatewayId", LogicMethod.CurrLogicMethod.GatewayId);
logicIfon.Add("name", logic.name);
logicIfon.Add("relation", logic.relation);
logicIfon.Add("enable", logic.enable);
@@ -274,8 +279,8 @@
logicIfon.Add("pushConfigs", pushConfigsArray);
logicjArray.Add(logicIfon);
- var jObject = new JObject { { "homeId", LogicMethod.HomeId }, { "logics", logicjArray } };
- responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Update);
+ var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } };
+ responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Update,5);
//濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken
if (responsePackNew.Code == StateCode.TOKEN_EXPIRED)
{
--
Gitblit v1.8.0