sunty
2019-07-26 805324d0ddac6215f8250c616c979c77a3a4f9f3
fix bug
2个文件已修改
9 ■■■■■ 已修改文件
controllers/dbtableperson.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/taglist.go 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/dbtableperson.go
@@ -149,7 +149,7 @@
    bytes, _ := json.Marshal(uuids)
    s := string(bytes)
    url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
        "/" + config.EsInfo.EsIndex.Dbtablepersons.IndexName + "/_update_by_query?refresh=wait_for" //   + config.EsInfo.EsIndex.Dbtablepersons.IndexType + "/"  + "/" + s
        "/" + config.EsInfo.EsIndex.Dbtablepersons.IndexName + "/_update_by_query?refresh" //   + config.EsInfo.EsIndex.Dbtablepersons.IndexType + "/"  + "/" + s
    params := "{\"script\":{\"lang\":\"painless\",\"inline\":\"ctx._source.isDelete = \\\"1\\\";" +
        "ctx._source.updateTime = \\\"" + time.Now().Format("2006-01-02 15:04:05") + "\\\"\"},\"query\":{\"terms\":{\"_id\":" + s + "}}}"
    logger.Debug("删除请求url:%s;\n 请求参数params:%s", url, params)
controllers/taglist.go
@@ -8,6 +8,7 @@
    "webserver/extend/config"
    "webserver/extend/esutil"
    "webserver/extend/util"
    "strconv"
)
//标签列表
@@ -25,7 +26,7 @@
    url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
        "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search"
    prama := "{\"query\":{\"bool\":{\"filter\":[{\"term\":{\"isDelete\":0}}]}},\"_source\":[\"tableName\",\"id\"]}"
    prama := "{\"query\":{\"bool\":{\"filter\":[]}},\"_source\":[\"tableName\",\"id\",\"isDelete\"]}"
    tokenRes := esutil.GetEsDataReq(url, prama, true)
    sources := make([]map[string]interface{}, 0)
@@ -35,7 +36,9 @@
        tokenRes["key"] = value.(map[string]interface{})["id"].(string)
        tokenRes["title"] = value.(map[string]interface{})["tableName"].(string)
        tokenRes["value"] = value.(map[string]interface{})["id"].(string)
        status = int(value.(map[string]interface{})["isDelete"].(float64))
         tokenRes["status"] = strconv.Itoa(status)
        sources = append(sources, tokenRes)
    }
    util.ResponseFormat(c, code.Success, sources)
}
}