From 087bf92d707de1a838451719da505f69b6934087 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期五, 29 十一月 2019 18:03:27 +0800
Subject: [PATCH] 换log

---
 algorithm/face/face.go |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/algorithm/face/face.go b/algorithm/face/face.go
index d692b01..c4dedde 100644
--- a/algorithm/face/face.go
+++ b/algorithm/face/face.go
@@ -2,14 +2,14 @@
 
 import (
 	"basic.com/pubsub/protomsg.git"
-	"basic.com/valib/logger.git"
+	logger "github.com/jeanphorn/log4go"
 	"github.com/knetic/govaluate"
 	"ruleprocess/structure"
 	"strconv"
 )
 // 浜鸿劯绠楁硶
-func Entrance(rule *protomsg.Rule, am *structure.AreaMap) structure.LittleRuleResult {
-	logger.Debug("---------璧颁簡浜鸿劯绠楁硶",rule.Id,rule.SdkArgAlias,rule.Operator,rule.SdkArgValue,am.AreaId)
+func Entrance(rule *protomsg.Rule, am *structure.AreaMap,lable *structure.Others,args *structure.SdkDatas,message *protomsg.SdkMessage) structure.LittleRuleResult {
+	logger.Debug("---------璧颁簡浜鸿劯妫�娴嬬畻娉�",rule.Id,rule.SdkArgAlias,rule.Operator,rule.SdkArgValue,am.AreaId)
 	return filterRule(rule,am)
 }
 
@@ -64,15 +64,16 @@
 						//logger.Info("-----------------------浜鸿劯杩囨护鐨刟rgs閲岀殑鏁伴噺锛�", len(args))
 						for _, arg := range args {
 							var formula string
-							if rule.SdkArgAlias == "score" {
-								formula = strconv.FormatFloat(arg.Score, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue // 寰楀埌瀛楃涓插叕寮�
-								logger.Info("褰撳墠鐩镐技搴﹀皬鍏紡锛�", formula)
-							} else if rule.SdkArgAlias == "proportion" {
-								formula = strconv.FormatFloat(arg.Proportion, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue // 寰楀埌瀛楃涓插叕寮�
-								logger.Info("褰撳墠鍗犳瘮灏忓叕寮忥細", formula)
-							} else {
-								formula = strconv.FormatFloat(arg.Size, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue // 寰楀埌瀛楃涓插叕寮�
-								logger.Info("褰撳墠灏哄灏忓叕寮忥細", formula)
+							switch rule.SdkArgAlias {
+							case "score":
+								formula = strconv.FormatFloat(arg.Score, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue
+								logger.Info("鐩镐技搴﹀皬鍏紡锛�", formula)
+							case "proportion":
+								formula = strconv.FormatFloat(arg.Proportion, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue
+								logger.Info("鍗犳瘮鍏紡锛�", formula)
+							case "size":
+								formula = strconv.FormatFloat(arg.Size, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue
+								logger.Info("灏哄灏忓叕寮忥細", formula)
 							}
 							expression, _ := govaluate.NewEvaluableExpression(formula) // 寰楀埌鏁板鍏紡
 							result, _ := expression.Evaluate(nil)                      // 寰楀埌鏁板鍏紡鐨勭粨鏋�

--
Gitblit v1.8.0