From 1152ed6c0dd453155ac71c87353d641d59c72a17 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期一, 23 九月 2019 19:57:09 +0800
Subject: [PATCH] fix url

---
 dbpersonApi.go |   37 +++++++++++++++++++++++++++++++++----
 1 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/dbpersonApi.go b/dbpersonApi.go
index 3e4786b..e1a07f0 100644
--- a/dbpersonApi.go
+++ b/dbpersonApi.go
@@ -42,6 +42,27 @@
 	return res.Success,res.Data
 }
 
+func (api DbPersonApi) UpdateFace(id string,faceFeature string, pic string) (bool,interface{}) {
+	url := BASIC_URL + DATA_URL_PREFIX + "/dbperson/updateFace"
+	client := NewClient()
+	paramBody := map[string]interface{}{
+		"id": id,
+		"faceFeature": faceFeature,
+		"personPicUrl": pic,
+	}
+	body,err := client.DoPostRequest(url,CONTENT_TYPE_JSON, paramBody,nil,nil)
+	if err != nil {
+		return false,nil
+	}
+
+	var res Result
+	if err = json.Unmarshal(body, &res); err != nil {
+		return false,nil
+	}
+
+	return res.Success,res.Data
+}
+
 func (api DbPersonApi) AddDbPerson(paramBody map[string]interface{}) (bool,interface{}) {
 	url := BASIC_URL + DATA_URL_PREFIX + "/dbperson/addDbPerson"
 	client := NewClient()
@@ -129,11 +150,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
 	}
@@ -163,12 +186,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