From 618bc9ed1a1ef4a413d83008d4549fa7a89d1d00 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期三, 18 十二月 2019 16:50:35 +0800
Subject: [PATCH] update sh
---
controllers/tasklist.go | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/controllers/tasklist.go b/controllers/tasklist.go
index e24848a..bef2c70 100644
--- a/controllers/tasklist.go
+++ b/controllers/tasklist.go
@@ -1,7 +1,10 @@
package controllers
import (
+ "basic.com/valib/logger.git"
"fmt"
+ "strconv"
+ "webserver/cache"
"github.com/gin-gonic/gin"
"webserver/extend/code"
@@ -10,7 +13,7 @@
"webserver/extend/util"
)
-//浠诲姟鍒楄〃
+// @Security ApiKeyAuth
// @Summary 浠诲姟鍒楄〃
// @Description 杩斿洖浠诲姟鍒楄〃
// @Accept json
@@ -18,11 +21,16 @@
// @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\"}}}}"
@@ -41,7 +49,7 @@
source["title"] = key.(string)
source["value"] = key.(string)
source["key"] = key.(string)
- sources := append(sources, source)
+ sources = append(sources, source)
fmt.Println(key)
}
--
Gitblit v1.8.0