add endTime GetFaceDataByTimeAndTotal
| | |
| | | |
| | | /*******************sort []map util*******************/ |
| | | //根据时间范围聚合所有区域人信息,返回固定条数 |
| | | func GetFaceDataByTimeAndTotal(startTime string, total int, thresholdTime int, thresholdStayTime int, serverIp string, serverPort string, indexName string) (resData []map[string]interface{}, err error) { |
| | | func GetFaceDataByTimeAndTotal(startTime string, endTime string, total int, thresholdTime int, thresholdStayTime int, serverIp string, serverPort string, indexName string) (resData []map[string]interface{}, err error) { |
| | | var requestUrl = "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_search" |
| | | var requestBody = `{ |
| | | "query": { |
| | |
| | | { |
| | | "range": { |
| | | "picDate": { |
| | | "gte": "` + startTime + `" |
| | | "gte": "` + startTime + `", |
| | | "lte": "` + endTime + `" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | |
| | | //统计各个区域人数 |
| | | func StatisticsEveryAreaPersonsNumber(startTime string, endTime string, serverIp string, serverPort string, indexName string) ([]map[string]interface{},error){ |
| | | func StatisticsEveryAreaPersonsNumber(startTime string, endTime string, serverIp string, serverPort string, indexName string) ([]map[string]interface{}, error) { |
| | | var requestUrl = "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_search" |
| | | var requestBody = `{ |
| | | "query": { |
| | |
| | | } |
| | | } |
| | | }` |
| | | buf,err := EsReq("POST",requestUrl,[]byte(requestBody)) |
| | | if err != nil{ |
| | | return nil,err |
| | | buf, err := EsReq("POST", requestUrl, []byte(requestBody)) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | result,err := SourceStatistics(buf) |
| | | if err != nil{ |
| | | return nil,err |
| | | result, err := SourceStatistics(buf) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | return result,nil |
| | | return result, nil |
| | | } |
| | | |
| | | /**************************************customer analysis util end**************************************/ |