| | |
| | | args.RuleResult = make(map[string]interface{}) |
| | | args.RuleResult["yolo"] = []Result{} |
| | | args.RuleResult["face"] = []Arg{} |
| | | if len(taskGroup.GroupRules) > 0 { |
| | | if taskGroup != nil && len(taskGroup.GroupRules) > 0 { |
| | | for _, group := range taskGroup.GroupRules { |
| | | //logger.Println("------------------------------任务规则:",taskRule) |
| | | taskId := taskGroup.TaskId |
| | |
| | | } |
| | | if completeFormula != "" { |
| | | logger.Info("结果公式-----------:", completeFormula) |
| | | expression, _ := govaluate.NewEvaluableExpression(completeFormula) |
| | | if strings.HasPrefix(completeFormula, "&&") || strings.HasPrefix(completeFormula, "||") { |
| | | expression, err := govaluate.NewEvaluableExpression(completeFormula) |
| | | if strings.HasPrefix(completeFormula, "&&") || strings.HasPrefix(completeFormula, "||") || err != nil{ |
| | | panic("规则有误,得到的数学公式不可解析") |
| | | } |
| | | result, _ := expression.Evaluate(nil) // 得到数学公式的结果 |