| | |
| | | package controllers |
| | | |
| | | import ( |
| | | "basic.com/dbapi.git" |
| | | "basic.com/valib/logger.git" |
| | | "fmt" |
| | | "strconv" |
| | | "strings" |
| | | "webserver/cache" |
| | | |
| | | "github.com/gin-gonic/gin" |
| | | "webserver/extend/code" |
| | |
| | | "webserver/extend/util" |
| | | ) |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 实时监控 |
| | | // @Description 实时监控比对数据 |
| | | // @Accept json |
| | |
| | | taskIdStr = "{\"terms\":{\"taskId\":[\"" + esTaskId + "\"]}}," |
| | | } |
| | | //请求头 |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | localConf, err2 := cache.GetServerInfo() |
| | | if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | util.ResponseFormat(c,code.ComError,"localConf wrong") |
| | | return |
| | | } |
| | | url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) + |
| | | "/" + index + "/_search" |
| | | |
| | | var setApi dbapi.SysSetApi |
| | | _, sysconf := setApi.GetServerInfo() |
| | | analyServerFilterStr := "{\"term\":{\"analyServerId\":\"" + sysconf.ServerId + "\"}}," |
| | | analyServerFilterStr := "{\"term\":{\"analyServerId\":\"" + localConf.ServerId + "\"}}," |
| | | |
| | | prama := "{\"query\":{\"bool\":{\"filter\":[" + |
| | | cameraIdStr + |