From 39d68f6919c56a86174a765ad6aa49c944e794a7 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期三, 31 七月 2019 10:32:03 +0800
Subject: [PATCH] log

---
 controllers/initForData.go |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/controllers/initForData.go b/controllers/initForData.go
index cce730b..4f96400 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)
@@ -37,7 +38,7 @@
 		"]}},\"size\":\"20\",\"sort\":[{\"picDate\":{\"order\":\"desc\"}}]," +
 		"\"_source\":[\"baseInfo\",\"alarmRules\",\"sex\",\"analyServerName\",\"sdkName\",\"ageDescription\",\"content\",\"id\",\"cameraAddr\",\"picMaxUrl\",\"picDate\",\"race\",\"videoUrl\",\"picSmUrl\",\"taskName\",\"isAlarm\",\"isAlarm\",\"analyServerIp\",\"cameraId\"]" +
 		"}"
-	fmt.Println(prama)
+	//logger.Debug("InitForCaptureData:", prama)
 	tokenRes := esutil.GetEsDataReq(url, prama, true)
 	util.ResponseFormat(c, code.Success, tokenRes)
 }
@@ -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 +
@@ -85,7 +86,8 @@
 		"\"sort\":[{\"picDate\":{\"order\":\"desc\"}}]," +
 		"\"size\":\"20\"," +
 		"\"_source\":[\"baseInfo\",\"alarmRules\",\"sex\",\"analyServerName\",\"sdkName\",\"ageDescription\",\"content\",\"id\",\"cameraAddr\",\"picMaxUrl\",\"picDate\",\"race\",\"videoUrl\",\"picSmUrl\",\"taskName\",\"personIsHub\",\"isAlarm\",\"analyServerIp\",\"cameraId\"]}"
-	fmt.Println(prama)
+	//logger.Debug("url:", url)
+	//logger.Debug("InitForMonitoringData:", prama)
 	tokenRes := esutil.GetEsDataReq(url, prama, true)
 	util.ResponseFormat(c, code.Success, tokenRes)
 }
\ No newline at end of file

--
Gitblit v1.8.0