From fca319958029fa924308e50cb61202d7d6ff5008 Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期三, 19 二月 2025 13:33:37 +0800
Subject: [PATCH] 暂停聚集模型

---
 db/db.go |  272 ++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 180 insertions(+), 92 deletions(-)

diff --git a/db/db.go b/db/db.go
index 4d479ec..9ab8704 100644
--- a/db/db.go
+++ b/db/db.go
@@ -57,15 +57,15 @@
 // InitDefaultData 鍒濆鍖栨暟鎹�
 func InitDefaultData() error {
 	var models = []*Model{
-		{
-			BaseModel: BaseModel{
-				ID: ModelIdGather,
-			},
-			Name:        "鐤戜技鑱氶泦",
-			Description: "閫氱敤鑱氶泦妯″瀷",
-			Version:     "v1.0.2",
-			Enabled:     false,
-		},
+		//{
+		//	BaseModel: BaseModel{
+		//		ID: ModelIdGather,
+		//	},
+		//	Name:        "鐤戜技鑱氶泦",
+		//	Description: "閫氱敤鑱氶泦妯″瀷",
+		//	Version:     "v1.0.2",
+		//	Enabled:     false,
+		//},
 		{
 			BaseModel: BaseModel{
 				ID: ModelIdDisappear,
@@ -82,7 +82,24 @@
 			Description: "閫氱敤鍦烘墍鍒嗘瀽妯″瀷",
 			Version:     "v1.0.0",
 			Enabled:     false,
+		}, {
+			BaseModel: BaseModel{
+				ID: ModelIdAccessRegularity,
+			},
+			Name:        "鍑鸿瑙勫緥鍒嗘瀽",
+			Description: "鍑鸿瑙勫緥鍒嗘瀽妯″瀷",
+			Version:     "v1.0.0",
+			Enabled:     false,
 		},
+		//{
+		//	BaseModel: BaseModel{
+		//		ID: ModelIdNightAnalysis,
+		//	},
+		//	Name:        "鏄间紡澶滃嚭鍒嗘瀽",
+		//	Description: "鏄间紡澶滃嚭鍒嗘瀽",
+		//	Version:     "v1.0.0",
+		//	Enabled:     false,
+		//},
 	}
 
 	for i := range models {
@@ -95,74 +112,74 @@
 	}
 
 	var rules = []*ModelRule{
-		{
-			Id:      "bfbdba7f-ee39-41fb-b188-b4c114a51eaa",
-			ModelId: ModelIdGather,
-			Scope:   "",
-			RuleArg: RuleArg{
-				Alias:    "gatherPersons",
-				Name:     "鑱氶泦浜烘暟",
-				Type:     "input",
-				Must:     true,
-				Unit:     "浜�",
-				Range:    "1,100",
-				Value:    "2",
-				ValType:  "int",
-				Operator: ">=",
-				Sort:     0,
-			},
-		},
-		{
-			Id:      "941bef84-ff7f-4460-b5dc-2ac6060304a4",
-			ModelId: ModelIdGather,
-			Scope:   "",
-			RuleArg: RuleArg{
-				Alias:    "appearInterval",
-				Name:     "鍑虹幇闂撮殧",
-				Type:     "input",
-				Must:     true,
-				Unit:     "绉�",
-				Range:    "1,7200",
-				Value:    "60",
-				ValType:  "int",
-				Operator: ">=",
-				Sort:     1,
-			},
-		},
-		{
-			Id:      "a9b50bae-2c40-40a1-9ebc-ac34850db964",
-			ModelId: ModelIdGather,
-			Scope:   "",
-			RuleArg: RuleArg{
-				Alias:    "threshold",
-				Name:     "鍑虹幇娆℃暟",
-				Type:     "input",
-				Must:     true,
-				Unit:     "娆�",
-				Range:    "1,60",
-				Value:    "1",
-				ValType:  "int",
-				Operator: ">=",
-				Sort:     2,
-			},
-		},
-		{
-			Id:      "aed7f95e-1ce6-4fa2-b1b3-aaf59ed86c50",
-			ModelId: ModelIdGather,
-			Scope:   "",
-			RuleArg: RuleArg{
-				Alias:    "daysWindow",
-				Name:     "鐩戞帶鏃堕棿",
-				Type:     "input",
-				Must:     true,
-				Unit:     "澶╁唴",
-				Range:    "1,7",
-				Value:    "1",
-				ValType:  "int",
-				Operator: "==",
-				Sort:     3,
-			},
-		},
+		//{
+		//	Id:      "bfbdba7f-ee39-41fb-b188-b4c114a51eaa",
+		//	ModelId: ModelIdGather,
+		//	Scope:   "",
+		//	RuleArg: RuleArg{
+		//		Alias:    "gatherPersons",
+		//		Name:     "鑱氶泦浜烘暟",
+		//		Type:     "input",
+		//		Must:     true,
+		//		Unit:     "浜�",
+		//		Range:    "1,100",
+		//		Value:    "2",
+		//		ValType:  "int",
+		//		Operator: ">=",
+		//		Sort:     0,
+		//	},
+		//},
+		//{
+		//	Id:      "941bef84-ff7f-4460-b5dc-2ac6060304a4",
+		//	ModelId: ModelIdGather,
+		//	Scope:   "",
+		//	RuleArg: RuleArg{
+		//		Alias:    "appearInterval",
+		//		Name:     "鍑虹幇闂撮殧",
+		//		Type:     "input",
+		//		Must:     true,
+		//		Unit:     "绉�",
+		//		Range:    "1,7200",
+		//		Value:    "60",
+		//		ValType:  "int",
+		//		Operator: ">=",
+		//		Sort:     1,
+		//	},
+		//},
+		//{
+		//	Id:      "a9b50bae-2c40-40a1-9ebc-ac34850db964",
+		//	ModelId: ModelIdGather,
+		//	Scope:   "",
+		//	RuleArg: RuleArg{
+		//		Alias:    "threshold",
+		//		Name:     "鍑虹幇娆℃暟",
+		//		Type:     "input",
+		//		Must:     true,
+		//		Unit:     "娆�",
+		//		Range:    "1,60",
+		//		Value:    "1",
+		//		ValType:  "int",
+		//		Operator: ">=",
+		//		Sort:     2,
+		//	},
+		//},
+		//{
+		//	Id:      "aed7f95e-1ce6-4fa2-b1b3-aaf59ed86c50",
+		//	ModelId: ModelIdGather,
+		//	Scope:   "",
+		//	RuleArg: RuleArg{
+		//		Alias:    "daysWindow",
+		//		Name:     "鐩戞帶鏃堕棿",
+		//		Type:     "input",
+		//		Must:     true,
+		//		Unit:     "澶╁唴",
+		//		Range:    "1,7",
+		//		Value:    "1",
+		//		ValType:  "int",
+		//		Operator: "==",
+		//		Sort:     3,
+		//	},
+		//},
 
 		// 鎵樼
 		{
@@ -224,15 +241,15 @@
 			Scope:   "",
 			RuleArg: RuleArg{
 				Alias:    "duration",
-				Name:     "鏃堕棿娈�",
+				Name:     "鐩戞帶鏃堕棿",
 				Type:     "input",
-				Must:     false,
-				Unit:     "澶�",
-				Range:    "1,2400",
+				Must:     true,
+				Unit:     "澶╁唴",
+				Range:    "1,60",
 				Value:    "30",
 				ValType:  "int",
-				Operator: ">=",
-				Sort:     2,
+				Operator: "==",
+				Sort:     1,
 			},
 		},
 		{
@@ -240,16 +257,16 @@
 			ModelId: ModelIdLocationAnalysis,
 			Scope:   "",
 			RuleArg: RuleArg{
-				Alias:    "personCount",
-				Name:     "鍑虹幇浜烘暟",
-				Type:     "input",
+				Alias:    "timeRange",
+				Name:     "鍑虹幇鏃堕棿",
+				Type:     "range",
 				Must:     true,
-				Unit:     "涓�",
-				Range:    "1,100",
-				Value:    "1, 90",
+				Unit:     "鐐�",
+				Range:    "0,23",
+				Value:    "9,10",
 				ValType:  "int",
-				Operator: ">=",
-				Sort:     0,
+				Operator: "==",
+				Sort:     2,
 			},
 		},
 		{
@@ -261,14 +278,85 @@
 				Name:     "鍑虹幇娆℃暟",
 				Type:     "input",
 				Must:     true,
-				Unit:     "",
+				Unit:     "娆�",
 				Range:    "",
 				Value:    "",
 				ValType:  "int",
 				Operator: ">=",
+				Sort:     0,
+			},
+		},
+
+		// 鍑鸿瑙勫緥
+		{
+			Id:      "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
+			ModelId: ModelIdAccessRegularity,
+			Scope:   "",
+			RuleArg: RuleArg{
+				Alias:    "duration",
+				Name:     "鐩戞帶鏃堕棿娈�",
+				Type:     "input",
+				Must:     true,
+				Unit:     "澶╁唴",
+				Range:    "1,60",
+				Value:    "30",
+				ValType:  "int",
+				Operator: ">=",
+				Sort:     0,
+			},
+		},
+		{
+			Id:      "f47ac10b-58cc-4372-a567-0e02b2c3d479",
+			ModelId: ModelIdAccessRegularity,
+			Scope:   "",
+			RuleArg: RuleArg{
+				Alias:    "timeRange",
+				Name:     "鍑鸿鏃堕棿娈�",
+				Type:     "range",
+				Must:     true,
+				Unit:     "鐐�",
+				Range:    "1,24",
+				Value:    "21,3",
+				ValType:  "int",
+				Operator: ">=",
 				Sort:     1,
 			},
 		},
+		{
+			Id:      "c9bf9e57-1685-4c89-bafb-ff5af830be8a",
+			ModelId: ModelIdAccessRegularity,
+			Scope:   "",
+			RuleArg: RuleArg{
+				Alias:    "appearances",
+				Name:     "鍑鸿娆℃暟",
+				Type:     "input",
+				Must:     false,
+				Unit:     "娆�",
+				Range:    "1,100",
+				Value:    "2",
+				ValType:  "int",
+				Operator: "==",
+				Sort:     2,
+			},
+		},
+		{
+			Id:      "e4eaaaf2-d142-11e1-b3e4-080027620cdd",
+			ModelId: ModelIdAccessRegularity,
+			Scope:   "",
+			RuleArg: RuleArg{
+				Alias:    "direction",
+				Name:     "杩涘嚭鏂瑰悜",
+				Type:     "select",
+				Must:     false,
+				Unit:     "",
+				Range:    "",
+				Value:    "",
+				ValType:  "string",
+				Operator: "==",
+				Options:  "[{\"label\":\"杩沑", \"value\":\"in\"},{\"label\":\"鍑篭", \"value\":\"out\"}]",
+				Sort:     3,
+			},
+		},
 	}
 
 	for i := range rules {

--
Gitblit v1.8.0