From a06945a8759b65aa653073cc83254f9c7f1ccf11 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期五, 26 七月 2019 14:04:08 +0800 Subject: [PATCH] fix esData --- controllers/initForData.go | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/controllers/initForData.go b/controllers/initForData.go index cce730b..2dbeb26 100644 --- a/controllers/initForData.go +++ b/controllers/initForData.go @@ -1,6 +1,7 @@ package controllers import ( + "basic.com/dbapi.git" "fmt" "github.com/gin-gonic/gin" "strings" @@ -20,7 +21,7 @@ // @Tags realTime // @Success 200 {string} json "{"code":200, msg:"鐩綍缁撴瀯鏁版嵁", success:true}" // @Failure 500 {string} json "{"code":500, msg:"杩斿洖閿欒淇℃伅", success:false}" -// @Router /data/api-v/realTime/action [POST] +// @Router /data/api-v/realTime/initForCaptureData [POST] //瀹炴椂鎶撴媿鏁版嵁鍒濆鍖� func (rc *RealTimeController) InitForCaptureData(c *gin.Context) { searchBody := make(map[string]interface{}, 0) @@ -50,13 +51,13 @@ // @Param obj body map true "搴曞簱鏁版嵁" // @Success 200 {string} json "{"code":200, msg:"鐩綍缁撴瀯鏁版嵁", success:true}" // @Failure 500 {string} json "{"code":500, msg:"杩斿洖閿欒淇℃伅", success:false}" -// @Router /data/api-v/realTime/monitoring [POST] +// @Router /data/api-v/realTime/initForMonitoringData [POST] //瀹炴椂鐩戞帶鏁版嵁鍒濆鍖� func (rc *RealTimeController) InitForMonitoringData(c *gin.Context) { searchBody := make(map[string]interface{}, 0) c.BindJSON(&searchBody) - index := config.EsInfo.EsIndex.VideoPersons.IndexName + index := config.EsInfo.EsIndex.VideoPersons.IndexName +","+config.EsInfo.EsIndex.Personaction.IndexName cameraIdStr := "" cameraId := searchBody["treeNodes"].([]interface{}) if cameraId != nil && len(cameraId) > 0 { @@ -75,7 +76,7 @@ "/" + index + "/_search" var setApi dbapi.SysSetApi _, sysconf := setApi.GetServerInfo() - analyServerFilterStr := "{\"term\":{\"analyServerId\":\"" + sysconf.ServerId + "\"}}," + analyServerFilterStr := "{\"term\":{\"analyServerId\":\"" + sysconf.ServerId + "\"}}" prama := "{\"query\":{\"bool\":{\"filter\":[" + cameraIdStr + -- Gitblit v1.8.0