From a66d7b87a8683347973b357cba3cb23bbf12c6b1 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期二, 28 七月 2020 20:24:04 +0800
Subject: [PATCH] score use float32

---
 esutil/EsClient.go |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/esutil/EsClient.go b/esutil/EsClient.go
index ea1a079..53a9edd 100644
--- a/esutil/EsClient.go
+++ b/esutil/EsClient.go
@@ -144,7 +144,9 @@
 					}
 
 					if bInfos,ok := source["baseInfo"]; ok && bInfos != nil {
-						d["baseInfo"] = getSourceBaseInfo(bInfos)
+						bd := getSourceBaseInfo(bInfos)
+						fmt.Println("bd:", bd)
+						d["baseInfo"] = bd
 					} else {
 						d["baseInfo"] = []interface{}{}
 					}
@@ -188,7 +190,7 @@
 type BaseInfo struct {
 	TaskId 			string 		`json:"taskId"`
 	TaskName 		string 		`json:"taskName"`
-	LikePer 		string 		`json:"likePer"`
+	LikePer 		float32 	`json:"likePer"`
 	TableId 		string 		`json:"tableId"`
 	TableName 		string 		`json:"tableName"`
 	PersonId 		string 		`json:"personId"`
@@ -207,7 +209,7 @@
 	TargetName 		string 		`json:"targetName"`
 	TargetId 		string 		`json:"targetId"`
 	TableId 		string 		`json:"tableId"`
-	CompareScore 	string 		`json:"compareScore"`
+	CompareScore 	float32 	`json:"compareScore"`
 	MonitorLevel 	string 		`json:"monitorLevel"`
 	Content 		string 		`json:"content"`
 	TableName 		string 		`json:"tableName"`
@@ -256,7 +258,11 @@
 					Content: t.Content,
 				})
 			}
+		} else {
+			fmt.Println("unmarshal bInfos err:", err)
 		}
+	} else {
+		fmt.Println("marshal bInfos err:", err)
 	}
 
 	return baseInfoArr

--
Gitblit v1.8.0