zhaoqingang
2025-02-19 fca319958029fa924308e50cb61202d7d6ff5008
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,
@@ -112,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,
      //   },
      //},
      // 托管
      {
@@ -241,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,
         },
      },
      {
@@ -257,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,
         },
      },
      {
@@ -278,12 +278,12 @@
            Name:     "出现次数",
            Type:     "input",
            Must:     true,
            Unit:     "",
            Unit:     "次",
            Range:    "",
            Value:    "",
            ValType:  "int",
            Operator: ">=",
            Sort:     1,
            Sort:     0,
         },
      },
@@ -353,7 +353,7 @@
            Value:    "",
            ValType:  "string",
            Operator: "==",
            Options: "[{\"label\":\"进\", \"value\":\"in\"},{\"label\":\"出\", \"value\":\"out\"}]",
            Options:  "[{\"label\":\"进\", \"value\":\"in\"},{\"label\":\"出\", \"value\":\"out\"}]",
            Sort:     3,
         },
      },