From c096b78dc74191e7746e5c351876a66c683c24e9 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期二, 28 七月 2020 20:20:02 +0800 Subject: [PATCH] add log --- esutil/EsClient.go | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/esutil/EsClient.go b/esutil/EsClient.go index 8257e1f..f67a2aa 100644 --- a/esutil/EsClient.go +++ b/esutil/EsClient.go @@ -132,7 +132,7 @@ if len(tiArr) > 0 { ti := tiArr[0] d["picSmUrl"] = ti.PicSmUrl - if ti.TargetType == "face" { + if ti.TargetType == "FaceDetect" { sLabelStr, ok := source["showLabels"] if ok { labelArr := strings.Split(sLabelStr.(string), "/") @@ -144,7 +144,9 @@ } if bInfos,ok := source["baseInfo"]; ok && bInfos != nil { - d["baseInfo"] = getSourceBaseInfo(bInfos) + bd := getSourceBaseInfo(bInfos) + fmt.Println("bd:", bd) + d["baseInfo"] = bd } else { d["baseInfo"] = []interface{}{} } @@ -256,7 +258,11 @@ Content: t.Content, }) } + } else { + fmt.Println("unmarshal bInfos err:", err) } + } else { + fmt.Println("marshal bInfos err:", err) } return baseInfoArr @@ -296,7 +302,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\"]}" + "}" err, tokenRes := GetEsDataReq(url, param, true) -- Gitblit v1.8.0