From 06a5b7be21e8c05bf3695754fe6f4714a7fccd68 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期五, 26 七月 2019 16:46:23 +0800
Subject: [PATCH] fix local and sync table
---
controllers/dbtablesCon.go | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/controllers/dbtablesCon.go b/controllers/dbtablesCon.go
index e2a12e1..ec2735b 100644
--- a/controllers/dbtablesCon.go
+++ b/controllers/dbtablesCon.go
@@ -1,6 +1,7 @@
package controllers
import (
+ "basic.com/dbapi.git"
"encoding/json"
"github.com/gin-gonic/gin"
"github.com/satori/go.uuid"
@@ -33,9 +34,9 @@
_, sysconf := setApi.GetServerInfo()
analyServerFilterStr := ""
if isSync == "1" {
- analyServerFilterStr = "{\"term\":{\"analyServerId\":\"" + sysconf.ServerId + "\"}}" // 鍚屾搴�
+ analyServerFilterStr = "{\"term\":{\"analyServerId\":\"\"}}" // / 鍚屾搴�
} else if isSync == "2" {
- analyServerFilterStr = "{\"term\":{\"analyServerId\":\"\"}}" // / 鏈湴搴�
+ analyServerFilterStr = "{\"term\":{\"analyServerId\":\"" + sysconf.ServerId + "\"}}" // 鏈湴搴�
}
params := "{\"query\":{\"bool\":{\"must\":[" +
"{\"term\":{\"isDelete\":\"0\"}}" + analyServerFilterStr + "]}}," +
@@ -109,13 +110,13 @@
c.BindJSON(&dbtable)
tableId := uuid.NewV4().String()
dbtable.Id = tableId
- if dbtable.analyServerId == "sync" {
+ if dbtable.AnalyServerId == "sync" {
+ dbtable.AnalyServerId = ""
+ }
+ if dbtable.AnalyServerId == "local" {
var setApi dbapi.SysSetApi
_, sysconf := setApi.GetServerInfo()
- dbtable.analyServerId = sysconf.ServerId
- }
- if dbtable.analyServerId == "local" {
- dbtable.analyServerId = ""
+ dbtable.AnalyServerId = sysconf.ServerId
}
url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
"/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + tableId + "?refresh=wait_for"
--
Gitblit v1.8.0