From 716810adb573f7e6b40ab52887b5b158d9824817 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期一, 16 九月 2019 17:04:03 +0800
Subject: [PATCH] 读公共的配置文件

---
 insertdata/insertDataToEs.go |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/insertdata/insertDataToEs.go b/insertdata/insertDataToEs.go
index 17f8053..1f53641 100644
--- a/insertdata/insertDataToEs.go
+++ b/insertdata/insertDataToEs.go
@@ -5,7 +5,6 @@
 	"encoding/json"
 	"errors"
 	"fmt"
-	"io/ioutil"
 	"net"
 	"ruleprocess/cache"
 	"ruleprocess/logger"
@@ -13,7 +12,6 @@
 	"time"
 
 	"basic.com/pubsub/protomsg.git"
-	"github.com/go-yaml/yaml"
 	"github.com/golang/protobuf/proto"
 	"github.com/satori/go.uuid"
 	"ruleprocess/ruleserver"
@@ -32,17 +30,9 @@
 }
 
 func init() {
-	data, err := ioutil.ReadFile("./config/conf.yml")
-	if err != nil {
-		fmt.Println("璇诲彇閰嶇疆鏂囦欢鍑洪敊--", err)
-		logger.Error("璇诲彇閰嶇疆鏂囦欢鍑洪敊--", err)
-	}
-	c := conf{}
-	//鎶妝aml褰㈠紡鐨勫瓧绗︿覆瑙f瀽鎴恠truct绫诲瀷
-	yaml.Unmarshal(data, &c)
-	weedfsUrl = c.PhotoUrl
-	videoPersonUrl = c.VideoPersons
-	personAction = c.PersonAction
+	weedfsUrl = "http://"+WeedFs.Ip+":"+strconv.Itoa(WeedFs.UploadPort)+"/submit"
+	videoPersonUrl = "http://"+EsInfo.Masterip+":"+EsInfo.Httpport+"/"+EsInfo.EsIndex.VideoPersons.IndexName+"/"+EsInfo.EsIndex.VideoPersons.IndexType
+	personAction = "http://"+EsInfo.Masterip+":"+EsInfo.Httpport+"/"+EsInfo.EsIndex.Personaction.IndexName+"/"+EsInfo.EsIndex.Personaction.IndexType
 }
 
 // 浜鸿劯鐨勬暟鎹粨鏋�

--
Gitblit v1.8.0