| | |
| | | type EsClusterInfo struct { |
| | | Ip string `json:"ip"` |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 比对数据查询 |
| | | // @Description 比对数据查询 |
| | | // @Accept json |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, "参数有误") |
| | | return |
| | | } |
| | | if searchBody.CompareNum != "" { |
| | | if searchBody.CompareNum !="" { |
| | | //二次搜索,不需要再比对了 |
| | | co := service.GetCompResultByNum(searchBody.CompareNum) |
| | | if co != nil { |
| | | //二次搜索和排序 |
| | | twiceM := GetCompareDataTwice(co, searchBody) |
| | | util.ResponseFormat(c, code.Success, twiceM) |
| | | twiceM := GetCompareDataTwice(co,searchBody) |
| | | util.ResponseFormat(c,code.Success,twiceM) |
| | | return |
| | | } else { |
| | | m := make(map[string]interface{}, 0) |
| | | m :=make(map[string]interface{},0) |
| | | m["compareNum"] = searchBody.CompareNum |
| | | m["total"] = 0 |
| | | m["totalList"] = []CompareResult{} |
| | | util.ResponseFormat(c, code.CompareResultGone, m) |
| | | util.ResponseFormat(c,code.CompareResultGone,m) |
| | | return |
| | | } |
| | | } |
| | | m := make(map[string]interface{}, 0) |
| | | m :=make(map[string]interface{},0) |
| | | m["compareNum"] = searchBody.CompareNum |
| | | m["total"] = 0 |
| | | m["totalList"] = []CompareResult{} |
| | | util.ResponseFormat(c, code.CompareResultGone, m) |
| | | util.ResponseFormat(c,code.CompareResultGone,m) |
| | | } |
| | | |
| | | func searchEsData(searchBody models.EsSearch) map[string]interface{} { |
| | |
| | | //使用es底层机制处理分页 |
| | | //请求头 |
| | | localConf, err2 := cache.GetServerInfo() |
| | | if err2 != nil || localConf.AlarmIp == "" || localConf.ServerId == "" { |
| | | if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" { |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return nil |
| | | } |