sunty
2019-09-29 b482e4600a874965ecc7d93d63af86c952390b86
EsApi.go
@@ -489,7 +489,7 @@
}
//初始化实时抓拍
func InitRealTimeCapture(serverIp string, serverPort string, indexName string, isAlarm bool   ) ([]protomsg.Videopersons, error){
func InitRealTimeCapture(serverIp string, serverPort string, indexName string, isAlarm bool   ,quantity int) ([]protomsg.Videopersons, error){
   var videopersonsInfo []protomsg.Videopersons
   url := "http://" + serverIp + ":" + serverPort +
      "/" + indexName + "/_search"
@@ -512,12 +512,11 @@
   },`
   }
   DSLJson := `{
   "size":20,
   "size":`+strconv.Itoa(quantity)+`,
   `+queryStr+`
   "sort":[{"picDate":{"order":"desc"}}],
   "_source": ["baseInfo", "alarmRules", "sex", "analyServerName", "sdkName", "ageDescription", "content", "id", "cameraAddr", "picMaxUrl", "picDate", "race", "videoUrl", "picSmUrl", "taskName", "personIsHub", "isAlarm", "analyServerIp", "cameraId"]
   }`
   buf, err := EsReq("POST", url, []byte(DSLJson))
   if err != nil {
      return videopersonsInfo, err