| | |
| | | package controllers |
| | | |
| | | import ( |
| | | "encoding/json" |
| | | "fmt" |
| | | |
| | | "github.com/gin-gonic/gin" |
| | |
| | | fmt.Println(tokenRes["datalist"].([]interface{})) |
| | | for _, value := range tokenRes["datalist"].([]interface{}) { |
| | | tokenRes := make(map[string]interface{}) |
| | | tokenRes["key"] = value.(map[string]interface{})["id"].(string) |
| | | key := value.(map[string]interface{})["id"].(string) |
| | | tokenRes["key"] = key |
| | | tokenRes["title"] = value.(map[string]interface{})["tableName"].(string) |
| | | tokenRes["value"] = value.(map[string]interface{})["id"].(string) |
| | | tokenRes["status"] = int(value.(map[string]interface{})["isDelete"]) |
| | | tokenRes["status"] = value.(map[string]interface{})["isDelete"] |
| | | if tokenRes["status"] == 1 { |
| | | if GetTotalFromDb(tokenRes["key"]) == false{ |
| | | if GetTotalFromDb(key) == false{ |
| | | continue |
| | | } |
| | | |
| | |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search" |
| | | prama := "{\"query\":{\"bool\":{\"filter\":[{\"term\":{\"baseInfo.tableId\":\""+id+"\"}}]}},\"size\":0}" |
| | | buf, err := EsReq("POST", url, []byte(prama)) |
| | | buf, err := esutil.EsReq("POST", url, []byte(prama)) |
| | | if err != nil { |
| | | fmt.Println("http request info is err!") |
| | | return |
| | |
| | | fmt.Println("first hits change error!") |
| | | return |
| | | } |
| | | total = int(middle["total"].(float64)) |
| | | total := int(middle["total"].(float64)) |
| | | fmt.Println(total) |
| | | if total>0 { |
| | | flag=true |