| | |
| | | package controllers |
| | | |
| | | import ( |
| | | "basic.com/valib/logger.git" |
| | | "fmt" |
| | | "strconv" |
| | | "webserver/cache" |
| | | |
| | | "github.com/gin-gonic/gin" |
| | | "webserver/extend/code" |
| | |
| | | "webserver/extend/util" |
| | | ) |
| | | |
| | | //任务列表 |
| | | // @Security ApiKeyAuth |
| | | // @Summary 任务列表 |
| | | // @Description 返回任务列表 |
| | | // @Accept json |
| | |
| | | // @Tags es |
| | | // @Success 200 {string} json "{"code":200, msg:"目录结构数据", success:true}" |
| | | // @Failure 500 {string} json "{"code":500, msg:"返回错误信息", success:false}" |
| | | // @Router /data/api-v/es/tagList [POST] |
| | | // @Router /data/api-v/es/taskList [POST] |
| | | func (sc *EsSearchController) PostEsTaskList(c *gin.Context) { |
| | | |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | "/" + config.EsInfo.EsIndex.VideoPersons.IndexName + "," + config.EsInfo.EsIndex.Personaction.IndexName + "/_search" |
| | | 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)) + |
| | | "/" + config.EsInfo.EsIndex.AiOcean.IndexName + "/_search" |
| | | |
| | | prama := "{\"size\":0,\"aggs\":{\"taskId_list\":{\"terms\":{\"field\":\"taskId\"}}}}" |
| | | |