From a8dc00e0473c493d8b54d9e1ceec9a2beb16ca1f Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期二, 24 九月 2019 20:43:57 +0800
Subject: [PATCH] findAllDbTablesByCurServer add isDelete arg
---
dbpersonApi.go | 39 ++++++++++++++++++++++++++++++++++-----
1 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/dbpersonApi.go b/dbpersonApi.go
index e874769..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.DoPostRequest(url,CONTENT_TYPE_JSON, nil,nil,nil)
+ paramBody := map[string]string{
+ "tableId": tableId,
+ }
+ body,err := client.DoGetRequest(url, paramBody,nil)
if err != nil {
return 0,err
}
@@ -143,7 +166,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 +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