From 69267f038f87f411edb92daed0ae67d93ca6c5fd Mon Sep 17 00:00:00 2001
From: sunty <suntianyu0923@163.com>
Date: 星期五, 02 八月 2019 10:09:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 controllers/dbtableperson.go |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/controllers/dbtableperson.go b/controllers/dbtableperson.go
index 6d7d5c7..bad1888 100644
--- a/controllers/dbtableperson.go
+++ b/controllers/dbtableperson.go
@@ -60,6 +60,17 @@
 	params := string(personbytes)
 	logger.Debug("璇锋眰url:%s;\n 璇锋眰鍙傛暟params:%s", url, params)
 	data, _ := esutil.PutEsDataReq(url, params)
+	//if data["_id"] !=""{
+	//	//閫氱煡姣斿杩涚▼缂撳瓨鏇存柊
+	//	discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
+	//		Type: protomsg.EsCacheChanged_T_DbTablePerson,
+	//		PersonId: personId,
+	//		TableId: []string{ dbperson.TableId },
+	//		Feature: dbperson.FaceFeature,
+	//		Action: protomsg.DbAction_Insert,
+	//	})
+	//}
+
 	//c.JSON(200, changeEsRespData(data, "娣诲姞浜哄憳鎴愬姛"))
 	result = changeEsRespData(data, "娣诲姞鎴愬姛")
 	return result
@@ -97,6 +108,23 @@
 	result := changeEsRespData(data, "淇敼鎴愬姛")
 	if result["success"].(bool) {
 		//code.Success.Message = "淇敼搴曞簱浜哄憳鎴愬姛"
+		//if dbperson.Enable == 1 {
+		//	discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
+		//		Type: protomsg.EsCacheChanged_T_DbTablePerson,
+		//		PersonId: dbperson.Id,
+		//		TableId: []string{ dbperson.TableId },
+		//		Feature: "",
+		//		Action: protomsg.DbAction_Insert,
+		//	})
+		//} else {
+		//	discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
+		//		Type: protomsg.EsCacheChanged_T_DbTablePerson,
+		//		PersonId: dbperson.Id,
+		//		TableId: []string{ dbperson.TableId },
+		//		Feature: "",
+		//		Action: protomsg.DbAction_Delete,
+		//	})
+		//}
 		util.ResponseFormat(c, code.Success, result["data"])
 	} else {
 		//code.ServiceInsideError.Message += result["msg"].(string)
@@ -127,6 +155,20 @@
 	result := changeEsRespData(data, "鍒犻櫎鎴愬姛")
 	if result["success"].(bool) {
 		//code.Success.Message = "鍒犻櫎搴曞簱浜哄憳鎴愬姛"
+		//閫氱煡姣斿杩涚▼锛屾浜哄凡鍒犻櫎
+		//dbperArr, e := esApi.Dbpersoninfosbyid([]string{uuid}, config.EsInfo.EsIndex.Dbtablepersons.IndexName, config.EsInfo.Masterip, config.EsInfo.Httpport)
+		//if e ==nil && len(dbperArr) > 0{
+		//	if dbperArr[0].TableId !=""{
+		//		discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
+		//			Type: protomsg.EsCacheChanged_T_DbTablePerson,
+		//			PersonId: uuid,
+		//			TableId: []string{ dbperArr[0].TableId },
+		//			Feature: "",
+		//			Action: protomsg.DbAction_Delete,
+		//		})
+		//	}
+		//}
+
 		util.ResponseFormat(c, code.Success, result["data"])
 	} else {
 		//code.ServiceInsideError.Message += result["msg"].(string)
@@ -158,6 +200,20 @@
 	//result := changeEsRespData(data, "鍒犻櫎鎴愬姛")
 	if data["error"] == nil {
 		//code.Success.Message = "鍒犻櫎搴曞簱浜哄憳鎴愬姛"
+		//dbperArr, e := esApi.Dbpersoninfosbyid(uuids, config.EsInfo.EsIndex.Dbtablepersons.IndexName, config.EsInfo.Masterip, config.EsInfo.Httpport)
+		//if e ==nil && len(dbperArr) > 0{
+		//	for _,esPer :=range dbperArr {
+		//		if esPer.TableId !=""{
+		//			discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
+		//				Type: protomsg.EsCacheChanged_T_DbTablePerson,
+		//				PersonId: esPer.Id,
+		//				TableId: []string{ esPer.TableId },
+		//				Feature: "",
+		//				Action: protomsg.DbAction_Delete,
+		//			})
+		//		}
+		//	}
+		//}
 		util.ResponseFormat(c, code.Success, "鍒犻櫎搴曞簱浜哄憳鎴愬姛")
 	} else {
 		//code.ServiceInsideError.Message += result["msg"].(string)

--
Gitblit v1.8.0