liuxiaolong
2019-08-22 f4e8f206a6760bdc31734dfcb1c65916b5b76311
service/EnableStatusControlService.go
@@ -2,13 +2,11 @@
import (
   "basic.com/dbapi.git"
   "basic.com/pubsub/protomsg.git"
   "encoding/json"
   "fmt"
   "strconv"
   "strings"
   "time"
   "webserver/discovery"
   "webserver/extend/config"
   "webserver/extend/esutil"
   "webserver/extend/logger"
@@ -19,7 +17,7 @@
      "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search"
   var setApi dbapi.SysSetApi
   _, sysconf := setApi.GetServerInfo()
   jsonDsl := `{
   jsonDSL := `{
   "query": {
      "bool": {
         "filter": [{
@@ -38,7 +36,7 @@
   "size": 10000
}
`
   buf, err := esutil.EsReq("POST", url, []byte(jsonDsl))
   buf, err := esutil.EsReq("POST", url, []byte(jsonDSL))
   if err != nil {
      logger.Debug(err)
   }
@@ -119,23 +117,23 @@
   }
   if middle > 0 {
      logger.Debug("修改成功")
      if flag {//生效的
         discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
            Type: protomsg.EsCacheChanged_T_DbTable,
            PersonId: "",
            TableId: id,
            Feature: "",
            Action: protomsg.DbAction_Insert,
         })
      } else {//失效的
         discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
            Type: protomsg.EsCacheChanged_T_DbTable,
            PersonId: "",
            TableId: id,
            Feature: "",
            Action: protomsg.DbAction_Insert,
         })
      }
      //if flag {//生效的
      //   discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
      //      Type: protomsg.EsCacheChanged_T_DbTable,
      //      PersonId: "",
      //      TableId: id,
      //      Feature: "",
      //      Action: protomsg.DbAction_Insert,
      //   })
      //} else {//失效的
      //   discovery.AddDbMessage(&protomsg.EsPersonCacheChange{
      //      Type: protomsg.EsCacheChanged_T_DbTable,
      //      PersonId: "",
      //      TableId: id,
      //      Feature: "",
      //      Action: protomsg.DbAction_Insert,
      //   })
      //}
      message = "修改成功"
   }
   return message