| | |
| | | |
| | | import ( |
| | | "basic.com/dbapi.git" |
| | | "basic.com/valib/logger.git" |
| | | "fmt" |
| | | "github.com/gin-gonic/gin" |
| | | "strconv" |
| | | "strings" |
| | | "webserver/cache" |
| | | "webserver/extend/code" |
| | | "webserver/extend/config" |
| | | "webserver/extend/esutil" |
| | |
| | | cameraIdStr = "{\"terms\":{\"cameraId\":[\"" + esCameraId + "\"]}}," |
| | | } |
| | | //请求头 |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | localConf, err2 := cache.GetServerInfo() |
| | | if err2 !=nil || localConf.AlarmIp == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | util.ResponseFormat(c,code.ComError,"es config err") |
| | | return |
| | | } |
| | | url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) + |
| | | "/" + index + "/_search" |
| | | |
| | | var setApi dbapi.SysSetApi |
| | |
| | | "\"sort\":[{\"picDate\":{\"order\":\"desc\"}}]," + |
| | | "\"size\":\"1000\"," + |
| | | "\"_source\":[\"baseInfo\",\"alarmRules\",\"sex\",\"analyServerName\",\"sdkName\",\"ageDescription\",\"content\",\"id\",\"cameraAddr\",\"picMaxUrl\",\"picDate\",\"race\",\"videoUrl\",\"picSmUrl\",\"taskName\",\"personIsHub\",\"isAlarm\",\"analyServerIp\",\"cameraId\"]}" |
| | | fmt.Println(prama) |
| | | tokenRes := esutil.GetEsDataReq(url, prama, true) |
| | | util.ResponseFormat(c, code.Success, tokenRes) |
| | | } |