From 75c6f6fea50b977cb72a50f4609a5cbbbf235c35 Mon Sep 17 00:00:00 2001 From: sunty <suntianyu0923@163.com> Date: 星期一, 29 七月 2019 10:07:56 +0800 Subject: [PATCH] delete analyServerId omitempty --- controllers/taglist.go | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/controllers/taglist.go b/controllers/taglist.go index d2253a8..d0226d0 100644 --- a/controllers/taglist.go +++ b/controllers/taglist.go @@ -25,17 +25,18 @@ url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search" - prama := "{\"query\":{\"match_all\":{}},\"_source\":[\"tableName\",\"uuid\"]}" + prama := "{\"query\":{\"bool\":{\"filter\":[]}},\"_source\":[\"tableName\",\"id\",\"isDelete\"]}" tokenRes := esutil.GetEsDataReq(url, prama, true) sources := make([]map[string]interface{}, 0) fmt.Println(tokenRes["datalist"].([]interface{})) for _, value := range tokenRes["datalist"].([]interface{}) { tokenRes := make(map[string]interface{}) - tokenRes["key"] = value.(map[string]interface{})["uuid"].(string) + tokenRes["key"] = value.(map[string]interface{})["id"].(string) tokenRes["title"] = value.(map[string]interface{})["tableName"].(string) - tokenRes["value"] = value.(map[string]interface{})["uuid"].(string) + tokenRes["value"] = value.(map[string]interface{})["id"].(string) + tokenRes["status"] = value.(map[string]interface{})["isDelete"] sources = append(sources, tokenRes) } util.ResponseFormat(c, code.Success, sources) -} +} \ No newline at end of file -- Gitblit v1.8.0