From 978757c6cd702684d736ddf733f1d718a8c67060 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期四, 01 八月 2019 21:08:44 +0800 Subject: [PATCH] add es cache change --- controllers/dbtablesCon.go | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/controllers/dbtablesCon.go b/controllers/dbtablesCon.go index e942fc8..d3f9f89 100644 --- a/controllers/dbtablesCon.go +++ b/controllers/dbtablesCon.go @@ -2,12 +2,14 @@ import ( "basic.com/dbapi.git" + "basic.com/pubsub/protomsg.git" "encoding/json" "fmt" "github.com/gin-gonic/gin" "github.com/satori/go.uuid" "log" "time" + "webserver/discovery" "webserver/extend/code" "webserver/extend/config" "webserver/extend/esutil" @@ -100,6 +102,23 @@ result := changeEsRespData(data, "淇敼鎴愬姛") if result["success"].(bool) { //code.Success.Message = "淇敼搴曞簱鎴愬姛" + if dbtable.Enable ==1 { + discovery.AddDbMessage(&protomsg.EsPersonCacheChange{ + Type: protomsg.EsCacheChanged_T_DbTable, + PersonId: "", + TableId: []string{ dbtable.Id }, + Feature: "", + Action: protomsg.DbAction_Insert, + }) + } else { + discovery.AddDbMessage(&protomsg.EsPersonCacheChange{ + Type: protomsg.EsCacheChanged_T_DbTable, + PersonId: "", + TableId: []string{ dbtable.Id }, + Feature: "", + Action: protomsg.DbAction_Delete, + }) + } util.ResponseFormat(c, code.Success, result["data"]) } else { //code.ServiceInsideError.Message += result["msg"].(string) -- Gitblit v1.8.0