| | |
| | | fmt.Println("body中获取底库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" |
| | | dbtable.PriUpdate() |
| | | dbTableByte, err := json.Marshal(dbtable) |
| | | if err != nil { |
| | |
| | | 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 { |
| | |
| | | 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) |