liuxiaolong
2019-07-26 914cf7bf26c100b5af62c55b00c58884fee4cbd0
controllers/initForData.go
@@ -1,6 +1,7 @@
package controllers
import (
   "basic.com/dbapi.git"
   "fmt"
   "github.com/gin-gonic/gin"
   "strings"
@@ -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)
}
@@ -56,7 +57,7 @@
   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)
}