| | |
| | | // 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, |
| | |
| | | } |
| | | |
| | | 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, |
| | | // }, |
| | | //}, |
| | | |
| | | // 托管 |
| | | { |
| | |
| | | } |
| | | |
| | | const ( |
| | | ModelIdDrug = "drug" // 涉毒 |
| | | ModelIdGather = "gather" // 聚集 |
| | | ModelIdDrug = "drug" // 涉毒 |
| | | //ModelIdGather = "gather" // 聚集 |
| | | ModelIdDisappear = "disappear" // 失踪 |
| | | ModelIdLocationAnalysis = "locationAnalysis" // 场所分析 |
| | | ModelIdAccessRegularity = "accessRegularity" // 出行规律分析 |
| | |
| | | } |
| | | |
| | | var modelRegistry = map[string]func() Model{ |
| | | "gather": func() Model { return &GatherModel{} }, |
| | | //"gather": func() Model { return &GatherModel{} }, |
| | | "disappear": func() Model { return &DisappearModel{} }, |
| | | "locationAnalysis": func() Model { return &LocationModel{} }, |
| | | "accessRegularity": func() Model { return &RegularityModel{} }, |