From d83f5863d6c675d6aed09cfe7bfdaadc0c6221d9 Mon Sep 17 00:00:00 2001
From: 554325746@qq.com <554325746@qq.com>
Date: 星期五, 05 七月 2019 18:32:05 +0800
Subject: [PATCH] fix enable and add update dbtable enable value
---
controllers/dbtablesCon.go | 6 +++---
models/model.go | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/controllers/dbtablesCon.go b/controllers/dbtablesCon.go
index 8a7adc6..e74d046 100644
--- a/controllers/dbtablesCon.go
+++ b/controllers/dbtablesCon.go
@@ -72,7 +72,7 @@
fmt.Println("body涓幏鍙栧簳搴搃d")
}
url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
- "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + uuid + "/_update"
+ "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + uuid + "/_update?refresh=wait_for"
dbtable.PriUpdate()
dbTableByte, err := json.Marshal(dbtable)
if err != nil {
@@ -108,7 +108,7 @@
tableId := uuid.NewV4().String()
dbtable.Id = tableId
url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
- "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + tableId
+ "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + tableId + "?refresh=wait_for"
dbtable.PriInsert() // 娣诲姞鏃堕棿鍜屽垱寤轰汉
dbTableByte, err := json.Marshal(dbtable)
if err != nil {
@@ -141,7 +141,7 @@
func (dbt DbTableController) DeleteDbTables(c *gin.Context) {
uuid := c.Params.ByName("id")
url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
- "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + uuid + "/_update"
+ "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + uuid + "/_update?refresh=wait_for"
params := "{\"doc\":{\"isDelete\":\"1\"}}"
fmt.Print("鍒犻櫎璇锋眰url:%s;\n 璇锋眰鍙傛暟params:%s", url, params)
data := esutil.GetEsDataReq(url, params, false)
diff --git a/models/model.go b/models/model.go
index fec50f8..7d86219 100644
--- a/models/model.go
+++ b/models/model.go
@@ -7,8 +7,8 @@
CreateTime string `json:"createTime,omitempty" example:""`
UpdateTime string `json:"updateTime,omitempty" example:""`
CreateBy string `json:"createBy,omitempty" example:""`
- IsDelete int `json:"isDelete,omitempty" example:"0 鏈垹闄� 1宸插垹闄�"`
- Enable int `json:"enable,omitempty" example:" 1鐢熸晥 0鏈敓鏁�"`
+ IsDelete int `json:"isDelete" example:"0 鏈垹闄� 1宸插垹闄�"`
+ Enable int `json:"enable" example:" 1鐢熸晥 0鏈敓鏁�"`
}
func (dp *BaseEntity) PriInsert() {
--
Gitblit v1.8.0