tcp server 用于给andriod 客户端定时发送消息
fix
liuxiaolong
2020-06-17 043acf60de48c730d8e146413ee18a82c4fbfa69
esutil/EsClient.go
@@ -63,7 +63,7 @@
         }
         d["id"] = value.(map[string]interface{})["_id"]
         d["picDate"] = source["picDate"]
         pmax, exist := source["picMaxUrl"]
         if !exist {
            continue
@@ -71,6 +71,8 @@
         pmArr := pmax.([]interface{})
         if len(pmArr) > 0 {
            d["picMaxUrl"] = pmArr[0]
         } else {
            d["picMaxUrl"] = ""
         }
         tB, err := json.Marshal(source["targetInfo"])
@@ -104,7 +106,13 @@
               } else {
                  d["baseInfo"] = []interface{}{}
               }
               d["sdkType"] = "人脸"
            } else {
               d["sdkType"] = source["sdkName"]
               d["picSmUrl"] = d["picMaxUrl"]
            }
         } else {
            d["picSmUrl"] = d["picMaxUrl"]
         }
@@ -232,7 +240,7 @@
      filterStr = strings.Join(filterArr, ",")
   }
   param := "{\"query\":{\"bool\":{\"filter\":["+filterStr+"]}},\"size\":\""+sizeStr+"\",\"sort\":[{\"picDate\":{\"order\":\"desc\"}}]," +
      "\"_source\":{\"includes\":[\"baseInfo\",\"targetInfo\",\"content\",\"id\",\"picMaxUrl\",\"picDate\",\"showLabels\",\"taskName\"],\"excludes\":[\"*.feature\",\"*.attachTarget\",\"*.targetLocation\",\"alarmRules\"]}" +
      "\"_source\":{\"includes\":[\"baseInfo\",\"targetInfo\",\"content\",\"id\",\"picMaxUrl\",\"picDate\",\"showLabels\",\"taskName\",\"sdkName\"],\"excludes\":[\"*.feature\",\"*.attachTarget\",\"*.targetLocation\",\"alarmRules\"]}" +
      "}"
   err, tokenRes := GetEsDataReq(url, param, true)
@@ -240,9 +248,7 @@
      log.Log.Errorln("GetEsDataReq err:", err)
      return nil
   }
    log.Log.Infoln("tokenRes:", tokenRes)
   jsonstring, _ := json.Marshal(tokenRes)
    log.Log.Infoln("len(result):", len(jsonstring))
   if len(jsonstring) <= 26 {
      return nil
   }