From f15a7ffa5a2fbc8bd37bd9d24a1f32f205dab5bb Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期四, 22 八月 2019 17:59:01 +0800
Subject: [PATCH] add FindCluster

---
 dbpersonApi.go |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dbpersonApi.go b/dbpersonApi.go
index 20209df..ec27bc3 100644
--- a/dbpersonApi.go
+++ b/dbpersonApi.go
@@ -129,11 +129,13 @@
 	return persons,nil
 }
 
-func (api DbPersonApi) GetPersonTotal () (total int64,err error) {
+func (api DbPersonApi) GetPersonTotal (tableId string) (total int64,err error) {
 	url := BASIC_URL + DATA_URL_PREFIX + "/dbperson/getPersonTotal"
 	client := NewClient()
-
-	body,err := client.DoGetRequest(url, nil,nil)
+	paramBody := map[string]string{
+		"tableId": tableId,
+	}
+	body,err := client.DoGetRequest(url, paramBody,nil)
 	if err != nil {
 		return 0,err
 	}
@@ -143,7 +145,7 @@
 		return 0,err
 	}
 
-	return res.Data.(int64),nil
+	return int64(res.Data.(float64)),nil
 }
 
 func (api DbPersonApi) GetPersonsCompareCacheBase (from int,size int) (persons []*protomsg.Esinfo,err error) {
@@ -163,12 +165,18 @@
 		return nil,err
 	}
 	dataBytes, _ := json.Marshal(res.Data)
+
 	var arr []protomsg.Esinfo
 	if err = json.Unmarshal(dataBytes, &arr);err !=nil {
 		return nil,err
 	}
 	for _,ei :=range arr {
-		persons = append(persons,&ei)
+		persons = append(persons,&protomsg.Esinfo{
+			Id: ei.Id,
+			Tableid: ei.Tableid,
+			FaceFeature: ei.FaceFeature,
+			Enable: ei.Enable,
+		})
 	}
 	return persons,nil
 }
\ No newline at end of file

--
Gitblit v1.8.0