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/Logic.cs | 142 ++++++++++++++++++++++++++++++-----------------
1 files changed, 90 insertions(+), 52 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
index a06cfa9..19c31ea 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
@@ -5,8 +5,22 @@
/// <summary>
/// 閫昏緫瀛樺偍鏁版嵁瀵硅薄
/// </summary>
+ [Serializable]
public class Logic
{
+
+ /// <summary>
+ /// 閫昏緫鍒楄〃
+ /// </summary>
+ public static List<Logic> LogicList = new List<Logic>();
+ /// <summary>
+ /// 褰撳墠閫昏緫
+ /// </summary>
+ public static Logic currlogic;
+ /// <summary>
+ /// 浜戠鍞竴id
+ /// </summary>
+ public string userLogicId = "";
/// <summary>
/// 閫昏緫鍞竴鏍囪瘑
/// </summary>
@@ -14,11 +28,11 @@
/// <summary>
/// 閫昏緫鍚嶇О
/// </summary>
- public string name = "閫昏緫涓�";
+ public string name = "鑷姩鍖�";
/// <summary>
/// 閫昏緫鏉′欢鍏崇郴锛堜笌and:锛屾垨:or锛�
/// </summary>
- public string relation = "or";
+ public string relation = "and";
/// <summary>
/// 閫昏緫鐘舵�侊紙true锛宖alse锛�
/// </summary>
@@ -36,73 +50,33 @@
/// </summary>
public List<Output> output = new List<Output>();
/// <summary>
- /// 鐢熸垚閫昏緫sid鏂规硶
+ /// 閫氱煡閰嶇疆
/// </summary>
- public string NewSid()
- {
- string logicId = "";
- try
- {
- string sOidBeginsWith = "000101";//鍘傚晢 + 閫氳鏂瑰紡
- DateTime dt = DateTime.Now;
- DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(2020, 1, 1));
- long m = (long)((dt - startTime).TotalMilliseconds / 10);
- string sTimeSpan = "00000000";
+ public NoticeConfig noticeConfig = new NoticeConfig();
+ /// <summary>
+ /// 鎺ㄩ�侀厤缃�
+ /// </summary>
+ public List<PushConfigs> pushConfigs = new List<PushConfigs>();
- byte[] arry = new byte[4];
- arry[0] = (byte)(m & 0xFF);
- arry[1] = (byte)((m & 0xFF00) >> 8);
- arry[2] = (byte)((m & 0xFF0000) >> 16);
- arry[3] = (byte)((m >> 24) & 0xFF);
- sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2");
-
-
- if (sTimeSpan.Length > 8)
- {
- sTimeSpan = sTimeSpan.Substring(0, 8);
- }
- else
- {
- sTimeSpan = "00000000";
- }
-
- logicId = sOidBeginsWith + sTimeSpan;
-
- logicId += "0A";
- logicId += "0A01";
- //0A01 鐗╂ā鍨嬩负閫昏緫锛� 0001 琛ㄧず 1 鍙烽�昏緫鍔熻兘
- int iTopLogicId = 1;
-
- Random random = new Random();
- iTopLogicId = random.Next(0, 255);
- iTopLogicId += random.Next(0, 255);
-
- logicId += iTopLogicId.ToString("X4");//閫昏緫鍙� 涓や釜byte
- logicId += "1100";
- }
- catch
- {
- return logicId;
- }
- return logicId;
- }
}
/// <summary>
/// 鎵ц鍛ㄦ湡瀵硅薄
/// </summary>
+ [Serializable]
public class Cycle
{
/// <summary>
/// 鏃堕棿绫诲瀷
/// (鎵ц涓�娆�:once锛屾瘡澶�:day锛屾瘡鏈�:mon锛屾槦鏈�:week锛屾棩鏈熸:date_to_date)
/// </summary>
- public string type = "";
+ public string type = "day";
public List<string> value = new List<string>();
}
/// <summary>
/// 杈撳叆鏉′欢瀵硅薄
/// </summary>
+ [Serializable]
public class Input
{
/// <summary>
@@ -119,13 +93,20 @@
/// 浜戠澶╂皵鏉′欢=6;
/// 鏌愪釜閫昏緫/鍦烘櫙鐨勮緭鍑烘潯浠�=7;
/// 鍦扮悊鍥存爮=8;
+ /// 绌烘皵璐ㄩ噺=9;
+ /// 鍦烘櫙=10;
/// </summary>
public string condition_type = "";
public List<Dictionary<string, string>> condition = new List<Dictionary<string, string>>();
+ /// <summary>
+ /// 鍦扮悊鍥存爮閰嶇疆
+ /// </summary>
+ public Fence geo_fence = new Fence();
}
/// <summary>
/// 杈撳嚭鐩爣瀵硅薄
/// </summary>
+ [Serializable]
public class Output
{
/// <summary>
@@ -133,15 +114,72 @@
/// </summary>
public string sid = "";
/// <summary>
+ /// 閫昏緫杈撳嚭鐩爣寤舵椂闂�(鍗曚綅鐢ㄧ)
+ /// </summary>
+ public string delay = "0";
+ /// <summary>
/// 閫昏緫杈撳嚭鐩爣绫诲瀷
/// 璁惧=1;
/// 鍦烘櫙=2;
/// 瀹夐槻=3;
+ /// 寤舵椂=4;
/// </summary>
public string target_type = "";
public List<Dictionary<string, string>> status = new List<Dictionary<string, string>>();
}
-
+ /// <summary>
+ /// 鍦扮悊鍥存爮閰嶇疆
+ /// </summary>
+ [Serializable]
+ public class Fence
+ {
+ /// <summary>
+ /// 缁忓害
+ /// </summary>
+ public string longitude = string.Empty;
+ /// <summary>
+ /// 绾害
+ /// </summary>
+ public string latitude = string.Empty;
+ /// <summary>
+ /// 鍗曚綅绫�
+ /// </summary>
+ public string radius = string.Empty;
+ }
+ /// <summary>
+ /// 閫氱煡閰嶇疆
+ /// </summary>
+ [Serializable]
+ public class NoticeConfig
+ {
+ /// <summary>
+ /// 鏄惁寮�鍚�氱煡
+ /// </summary>
+ public bool enable = false;
+ /// <summary>
+ /// 閫氱煡鍐呭
+ /// </summary>
+ public string noticeContent = "鑷姩鍖栧凡缁忔墽琛�";//string.Empty;
+ }
+ /// <summary>
+ /// 鎺ㄩ�侀厤缃�
+ /// </summary>
+ [Serializable]
+ public class PushConfigs
+ {
+ /// <summary>
+ /// 鎺ㄩ�佹柟寮�(APP/SMS)
+ /// </summary>
+ public string pushMethod = "APP";
+ /// <summary>
+ /// 鎺ㄩ�佸唴瀹�
+ /// </summary>
+ //public string pushContent = string.Empty;
+ /// <summary>
+ /// 鎺ㄩ�佺洰鏍�
+ /// </summary>
+ public List<string> pushTarget = new List<string> {};
+ }
}
--
Gitblit v1.8.0