| | |
| | | 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){ |
| | | |
| | | } |
| | |
| | | "fmt" |
| | | "github.com/go-yaml/yaml" |
| | | "io/ioutil" |
| | | "os" |
| | | "ruleprocess/cache" |
| | | "ruleprocess/logger" |
| | | "strconv" |
| | |
| | | logger.Error("根据id查询底库信息出错!",err,"--返回值长度为:",len(table)) |
| | | } |
| | | base := BaseInfo{TableId:baseinfo.TableId,TableName:table[0].TableName,BwType:table[0].BwType,CompareScore:Retain(m[baseinfo.Id]),PersonId:baseinfo.Id,PersonName:baseinfo.PersonName,PersonPicUrl:baseinfo.PersonPicUrl,PhoneNum:baseinfo.PhoneNum,Sex:baseinfo.Sex,MonitorLevel:baseinfo.MonitorLevel,Content:""} |
| | | logger.Debug("看看这个base的对比值是多少:",base) |
| | | os.Exit(1) |
| | | //logger.Debug("看看这个base的对比值是多少:",base) |
| | | //os.Exit(1) |
| | | arg.Liker = append(arg.Liker, &base) |
| | | } |
| | | } |