From 9d4aea534b369527a0470095ddaff6929c2cdf52 Mon Sep 17 00:00:00 2001 From: sunty <1172534965@qq.com> Date: 星期三, 20 十一月 2019 14:53:51 +0800 Subject: [PATCH] update to new feature caching --- EsClient.go | 34 ++++++++++------------------------ 1 files changed, 10 insertions(+), 24 deletions(-) diff --git a/EsClient.go b/EsClient.go index 1f01186..de3b5af 100644 --- a/EsClient.go +++ b/EsClient.go @@ -61,38 +61,24 @@ var ok bool for _, source := range sources { var tmpinfo protomsg.Esinfo - tmpinfo.FaceFeature, ok = source["faceFeature"].(string) - if !ok { - continue - } - tmpinfo.Id, ok = source["id"].(string) if !ok { continue } - tmpinfo.Tableid, ok = source["tableId"].(string) + if source["targetInfo"] != nil { + for _, v := range source["targetInfo"].([]interface{}) { + m := v.(map[string]interface{}) + tmpinfo.FaceFeature,ok = m["feature"].(string) + if !ok { + continue + } + } + } + tmpinfo.AnalyServerId, ok = source["analyServerId"].(string) if !ok { continue } - esinfos = append(esinfos, &tmpinfo) - - // tmpinfo.PersonName,ok = source["personName"].(string) - // //Isnil("personName", ok) - // tmpinfo.PersonPicUrl,ok = source["personPicUrl"].(string) - // //Isnil("personPicUrl", ok) - // tmpinfo.PhoneNum,ok = source["phoneNum"].(string) - // //Isnil("phoneNum", ok) - // tmpinfo.Sex,ok = source["sex"].(string) - // //Isnil("sex", ok) - // tmpinfo.Idcard,ok = source["idCard"].(string) - // //Isnil("idCard", ok) - // tmpinfo.MonitorLevel,ok = source["monitorLevel"].(string) - - // 鏍规嵁 tableid 鑾峰彇 tablename - // name, _:= Dbtablename(tmpinfo.TableId) - // tmpinfo.TableName= name - // binfos.Infos = append(binfos.Infos, &tmpinfo) } return -- Gitblit v1.8.0