From 89a3b406aabf07ba6faf0b6eb2a0c147d62b75d5 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期二, 28 七月 2020 19:08:22 +0800
Subject: [PATCH] add log

---
 esutil/EsClient.go |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/esutil/EsClient.go b/esutil/EsClient.go
index 8257e1f..ddadef7 100644
--- a/esutil/EsClient.go
+++ b/esutil/EsClient.go
@@ -100,11 +100,16 @@
 			}
 			alarmRules, exist := source["alarmRules"]
 			if exist {
+				fmt.Println("exist alarmRules")
 				if alarmB,ae := json.Marshal(alarmRules);ae ==nil {
 					var alarmRArr []AlarmRule
 					if ae = json.Unmarshal(alarmB, &alarmRArr);ae ==nil && len(alarmRArr) >0 {
 						d["alarmLevel"] = alarmRArr[0].AlarmLevel
+					} else {
+						fmt.Println("unmarshal ae:", ae)
 					}
+				} else {
+					fmt.Println("ae:", ae)
 				}
 			} else {
 				d["alarmLevel"] = ""
@@ -296,7 +301,7 @@
 		mustNotStr = strings.Join(mustNotArr, ",")
 	}
 	param := "{\"query\":{\"bool\":{\"filter\":["+filterStr+"],\"must_not\":["+mustNotStr+"]}},\"size\":\""+sizeStr+"\",\"sort\":[{\"picDate\":{\"order\":\"desc\"}}]," +
-		"\"_source\":{\"includes\":[\"cameraAddr\",\"baseInfo\",\"targetInfo\",\"content\",\"id\",\"picMaxUrl\",\"picDate\",\"showLabels\",\"taskName\",\"sdkName\",\"videoUrl\"],\"excludes\":[\"*.feature\",\"*.attachTarget\",\"*.targetLocation\",\"alarmRules\"]}" +
+		"\"_source\":{\"includes\":[\"cameraAddr\",\"baseInfo\",\"targetInfo\",\"content\",\"id\",\"picMaxUrl\",\"picDate\",\"showLabels\",\"taskName\",\"sdkName\",\"videoUrl\",\"alarmRules\"],\"excludes\":[\"*.feature\",\"*.attachTarget\",\"*.targetLocation\",\"alarmRules\"]}" +
 		"}"
 	err, tokenRes := GetEsDataReq(url, param, true)
 

--
Gitblit v1.8.0