From c05a93ddb0714a310a31574aaf030e677d9a07b6 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 06 一月 2023 17:43:31 +0800
Subject: [PATCH] 增加多网关绑定支持
---
Crabtree/SmartHome/HDL/Common/HDLLinkScene.cs | 77 ++++++++++++--------------------------
1 files changed, 24 insertions(+), 53 deletions(-)
diff --git a/Crabtree/SmartHome/HDL/Common/HDLLinkScene.cs b/Crabtree/SmartHome/HDL/Common/HDLLinkScene.cs
index 2bfe2c2..1f9b2b6 100644
--- a/Crabtree/SmartHome/HDL/Common/HDLLinkScene.cs
+++ b/Crabtree/SmartHome/HDL/Common/HDLLinkScene.cs
@@ -3,17 +3,20 @@
namespace Shared
{
-
+
#region 鈻� 鍦烘櫙鍒楄〃鐩稿叧___________________________
#endregion
-
/// <summary>
///
/// </summary>
- public class HDLLinkScene
+ public class HDLLinkSceneBase
{
+ /// <summary>
+ /// 鍦烘櫙sid
+ /// </summary>
+ public string userSceneId;
/// <summary>
/// 鍦烘櫙sid
/// </summary>
@@ -51,6 +54,23 @@
/// </summary>
public bool collect = false;
/// <summary>
+ /// 淇敼鏃堕棿
+ /// </summary>
+ public string modifyTime;
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ /// </summary>
+ public string createTime;
+
+
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ public class HDLLinkScene: HDLLinkSceneBase
+ {
+ /// <summary>
/// 鍦烘櫙鍔熻兘鍒楄〃
/// </summary>
public List<SceneFunction> functions = new List<SceneFunction> ();
@@ -59,56 +79,7 @@
/// </summary>
public List<ScenePushConfig> pushConfigs = new List<ScenePushConfig> ();
- /// <summary>
- /// 鐢熸垚閫昏緫sid鏂规硶
- /// </summary>
- public string NewSid ()
- {
- string sceneId = "";
- 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";
-
- 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";
- }
-
- sceneId = sOidBeginsWith + sTimeSpan;
-
- sceneId += "0A";
- sceneId += "0A01";
- int maxId = 1;
-
- Random random = new Random (Guid.NewGuid ().GetHashCode ());
- maxId = random.Next (1000);
-
- //for (int i = 0; i < FunctionList.List.scenes.Count; i++) {
- // string s = FunctionList.List.scenes [i].sid.Substring (20, 4);
- // int iThisSceneId = Convert.ToInt16 (s, 16);
- // if (iThisSceneId > maxId)
- // maxId = iThisSceneId;
- //}
-
- sceneId += (maxId + 1).ToString ("X4");
- sceneId += "0000";
- } catch {
- return sceneId;
- }
- return sceneId;
- }
+
}
--
Gitblit v1.8.0