From 44c0510dc671b1171a9e0c612c29fca6ec2b17c3 Mon Sep 17 00:00:00 2001
From: sunty <1172534965@qq.com>
Date: 星期日, 23 八月 2020 16:25:54 +0800
Subject: [PATCH] add w h
---
EsClient.go | 6 +++++-
EsApi.go | 5 +++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/EsApi.go b/EsApi.go
index 1bce2f9..b812bf5 100644
--- a/EsApi.go
+++ b/EsApi.go
@@ -201,7 +201,8 @@
"updateTime",
"picMaxUrl",
"targetInfo.belongsTargetId",
- "targetInfo.targetLocation"
+ "targetInfo.targetLocation",
+ "picWH"
]
}
}`
@@ -285,7 +286,7 @@
}
],
"_source":{
- "includes":["baseInfo.targetId","cameraId","cameraName","cameraAddr","targetInfo.targetScore","targetInfo.picSmUrl","showLabels","baseInfo.tableId","baseInfo.tableName","baseInfo.bwType","baseInfo.targetName","baseInfo.compareScore","picDate","picMaxUrl"]
+ "includes":["baseInfo.targetId","cameraId","cameraName","cameraAddr","targetInfo.targetScore","targetInfo.picSmUrl","showLabels","baseInfo.tableId","baseInfo.tableName","baseInfo.bwType","baseInfo.targetName","baseInfo.compareScore","picDate","picMaxUrl","picWH"]
}
}
}
diff --git a/EsClient.go b/EsClient.go
index 30f182a..a1712d0 100644
--- a/EsClient.go
+++ b/EsClient.go
@@ -533,7 +533,7 @@
if startTime != "" {
sinTime, _ := time.ParseInLocation("2006-01-02 15:04:05", startTime, loc)
stayTime = math.Abs(sinTime.Sub(mTime).Seconds())
- if stayTime <= thresholdTime {
+ if stayTime <= thresholdTime {
startTime = tmpTime
hitsSources[len(hitsSources)-1]["endTime"] = tmpTime
continue
@@ -564,6 +564,7 @@
tmpHitSource["stayTime"] = stayTime
tmpHitSource["endTBackGroundPicUrl"] = source["picMaxUrl"].([]interface{})
tmpHitSource["endTFacePicUrl"] = targetInfo["picSmUrl"].(string)
+ tmpHitSource["picWH"] = source["picWH"].(map[string]interface{})
hitsSources = append(hitsSources, tmpHitSource)
}
allSource = append(allSource, hitsSources...)
@@ -607,6 +608,9 @@
stayTime := endT.Sub(startT).Seconds()
source["stayTime"] = stayTime
source["endBackGroundPicUrl"] = pixMaxUrl[len(pixMaxUrl)-1]
+ if info["picWH"] != nil {
+ source["picWH"] = info["picWH"].(map[string]interface{})
+ }
sources = append(sources, source)
}
--
Gitblit v1.8.0