| | |
| | | import ( |
| | | "github.com/knetic/govaluate" |
| | | "ruleprocess/logger" |
| | | "ruleprocess/ruleserver" |
| | | ) |
| | | |
| | | func Judge(){ |
| | | //拿到所有规则组 |
| | | |
| | | //遍历所有的规则组,看看符合哪个规则组,就把数据插入到哪个规则组的目标机器上 |
| | | |
| | | //先判断时间规则,不符合此规则,直接略过 |
| | | |
| | | //遍历规则组中的小规则,每个小规则得出一个string类型的bool值,然后用 && 或 || 拼接起来 |
| | | |
| | | //得出总的判断结果 |
| | | |
| | | //符合本规则组的就把数据推送到该目的服务器上 |
| | | } |
| | | // |
| | | func timeJudge(label *Label,groupRule *GroupRule){ |
| | | // 是否符合时间规则 |
| | | func timeJudge(label *Label,groupRule *GroupRule) string{ |
| | | |
| | | } |
| | | // 传入两个时间的字符串,判断第一个时间是否小于第二个时间 |
| | |
| | | logger.Error("带入参数有误") |
| | | } |
| | | return result.(bool) |
| | | } |
| | | |
| | | // 是否符合摄像机规则 |
| | | func cameraJudge(label *Label,rule *Rule) string{ |
| | | return "true" |
| | | } |
| | | |
| | | // 是否符合底库规则 |
| | | func baseJudge(label *Label,rule *Rule) string{ |
| | | return "true" |
| | | } |
| | | |
| | | //是否符合人员规则 |
| | | func personJudge(label *Label,rule *Rule) string{ |
| | | return "true" |
| | | } |
| | | |
| | | // 是否符合布防等级规则 |
| | | func defenceJudge(label *Label,rule *Rule) string{ |
| | | return "true" |
| | | } |
| | | // 调用目标服务器的插入接口 |
| | | func pushData (data ruleserver.ResultMsg){ |
| | | |
| | | } |