| | |
| | | |
| | | 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" |
| | |
| | | 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, |
| | | }) |
| | | } |
| | | //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) |