From e320f5c14d9833ba2c7f6bdcc62ffda866ad7fdc Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期四, 18 七月 2019 16:40:54 +0800
Subject: [PATCH] ---

---
 insertdata/insertDataToEs.go |   75 +++++++++++++++++++------------------
 1 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/insertdata/insertDataToEs.go b/insertdata/insertDataToEs.go
index 60fea44..e0b081d 100644
--- a/insertdata/insertDataToEs.go
+++ b/insertdata/insertDataToEs.go
@@ -19,12 +19,15 @@
 	"ruleprocess/util"
 )
 
-var weedfsUrl,videoPersonUrl,personAction string
+var weedfsUrl, videoPersonUrl, personAction string
 
 type conf struct {
-	PhotoUrl     string `yaml:"photoUrl"`
-	Videopersons string `yaml:"videopersons"`
-	Personaction string `yaml:"personaction"`
+	PhotoUrl       string `yaml:"photoUrl"`
+	Videopersons   string `yaml:"videoPersons"`
+	Personaction   string `yaml:"personAction"`
+	Serverip       string `yaml:"serverIp"`
+	Serverport     string `yaml:"serverPort"`
+	Dbtablepersons string `yaml:"dbTablePersons"`
 }
 
 func init() {
@@ -43,35 +46,35 @@
 
 // 浜鸿劯鐨勬暟鎹粨鏋�
 type PerVideoPicture struct {
-	Id              string               `json:"id"`
-	CameraId        string               `json:"cameraId"`
-	CameraAddr      string               `json:"cameraAddr"`
-	PicDate         string               `json:"picDate"`
-	PicMaxUrl       string               `json:"picMaxUrl"`
-	TaskId          string               `json:"taskId"`
-	TaskName        string               `json:"taskName"`
-	SdkName         string               `json:"sdkName"`
-	Content         string               `json:"content"`
-	LikeDate        string               `json:"likeDate"`
-	Sex             string               `json:"sex"`
-	Age             int32                `json:"age"`
-	AgeDescription  string               `json:"ageDescription"`
-	Race            string               `json:"race"`
-	SmileLevel      int32                `json:"smileLevel"`
-	BeautyLevel     int32                `json:"beautyLevel"`
-	FaceFeature     string               `json:"faceFeature"`
-	PicSmUrl        []string             `json:"picSmUrl"`
-	VideoUrl        string               `json:"videoUrl"`
-	AnalyServerId   string               `json:"analyServerId"`
-	AnalyServerName string               `json:"analyServerName"`
-	AnalyServerIp   string               `json:"analyServerIp"`
-	ClusterId       string               `json:"clusterId"`
-	DetectScore     float64              `json:"detectScore"`
-	IsAlarm         int                  `json:"isAlarm"`
-	IsAckAlarm      int                  `json:"isAckAlarm"`
-	IsCollect       int                  `json:"isCollect"`
-	IsDelete        int                  `json:"isDelete"`
-	BaseInfo        []*protomsg.Baseinfo `json:"baseInfo"`
+	Id              string                 `json:"id"`
+	CameraId        string                 `json:"cameraId"`
+	CameraAddr      string                 `json:"cameraAddr"`
+	PicDate         string                 `json:"picDate"`
+	PicMaxUrl       string                 `json:"picMaxUrl"`
+	TaskId          string                 `json:"taskId"`
+	TaskName        string                 `json:"taskName"`
+	SdkName         string                 `json:"sdkName"`
+	Content         string                 `json:"content"`
+	LikeDate        string                 `json:"likeDate"`
+	Sex             string                 `json:"sex"`
+	Age             int32                  `json:"age"`
+	AgeDescription  string                 `json:"ageDescription"`
+	Race            string                 `json:"race"`
+	SmileLevel      int32                  `json:"smileLevel"`
+	BeautyLevel     int32                  `json:"beautyLevel"`
+	FaceFeature     string                 `json:"faceFeature"`
+	PicSmUrl        []string               `json:"picSmUrl"`
+	VideoUrl        string                 `json:"videoUrl"`
+	AnalyServerId   string                 `json:"analyServerId"`
+	AnalyServerName string                 `json:"analyServerName"`
+	AnalyServerIp   string                 `json:"analyServerIp"`
+	ClusterId       string                 `json:"clusterId"`
+	DetectScore     float64                `json:"detectScore"`
+	IsAlarm         int                    `json:"isAlarm"`
+	IsAckAlarm      int                    `json:"isAckAlarm"`
+	IsCollect       int                    `json:"isCollect"`
+	IsDelete        int                    `json:"isDelete"`
+	BaseInfo        []*ruleserver.BaseInfo `json:"baseInfo"`
 }
 
 //  yolo琛屼负鐨勬暟鎹粨鏋�
@@ -267,7 +270,7 @@
 		0,
 		0,
 		0,
-		[]*protomsg.Baseinfo{},
+		[]*ruleserver.BaseInfo{},
 	}
 	requstbody, err := json.Marshal(pervideo)
 
@@ -307,7 +310,7 @@
 		if len(alarmRules) > 0 {
 			isAlarm = 1
 			//resp, err = util.PostFormBufferData(weedfsUrl, i, uuid.NewV4().String())
-			resp, err = util.DrawPolygonOnImage(msg.Cid, i, msg.RuleResult["yolo"].([]ruleserver.Result))
+			resp, err = util.DrawPolygonOnImage(msg.Cid, i, msg.RuleResult["yolo"].([]ruleserver.Result), weedfsUrl)
 			if err != nil {
 				logger.Error("鐢绘鎴栦笂浼犲浘鐗囨湇鍔″櫒鍑洪敊", err)
 			} else {
@@ -382,7 +385,7 @@
 	i := protomsg.Image{}
 	err = proto.Unmarshal(bdata, &i)
 	//resp, err = util.PostFormBufferData(weedfsUrl, i, uuid.NewV4().String())
-	resp, err := util.DrawPolygonOnImage(msg.Cid, i, msg.RuleResult["yolo"].([]ruleserver.Result))
+	resp, err := util.DrawPolygonOnImage(msg.Cid, i, msg.RuleResult["yolo"].([]ruleserver.Result), weedfsUrl)
 	if err != nil {
 		logger.Error("鐢绘鎴栦笂浼犲浘鐗囨湇鍔″櫒鍑洪敊", err)
 	} else {

--
Gitblit v1.8.0