| | |
| | | // Getdbpersonmsg("") |
| | | //} |
| | | |
| | | func Getdbpersonmsg(teststring string, IsCompare bool) ([]protomsg.Baseinfo) { |
| | | func Getdbpersonmsg(teststring string, IsCompare bool) ([]byte) { |
| | | |
| | | var binfos protomsg.Binfos |
| | | |
| | | if !IsCompare { |
| | | return nil |
| | |
| | | |
| | | firsttime := time.Now() |
| | | Rscore := Cmap.Walk(Printest, teststring) |
| | | |
| | | binfos.Infos = append(binfos.Infos, Rscore...) |
| | | binfosbytes, err := binfos.Marshal() |
| | | if err != nil { |
| | | fmt.Println(err) |
| | | return nil |
| | | } |
| | | fmt.Println(time.Since(firsttime)) |
| | | return Rscore |
| | | return binfobytes |
| | | } |
| | | |
| | | func Printest(ci, co string ) (float32){ |
| | |
| | | "basic.com/pubsub/protomsg.git" |
| | | ) |
| | | |
| | | |
| | | func GetDbinfo(dbinforequest string)([]byte, error) { |
| | | buf , err := EsReq("POST", "http://192.168.1.182:9200/dbtablepersons/dbpersons/_search", []byte(dbinforequest)) |
| | | return buf, err |
| | | } |
| | | |
| | | |
| | | func Parsesources(sources []map[string]interface{}) []protomsg.Baseinfo { |
| | | var tmpinfo protomsg.Baseinfo |
| | | var baseinfos []protomsg.Baseinfo |
| | | func Parsesources(sources []map[string]interface{}) []*protomsg.Baseinfo { |
| | | var baseinfos []*protomsg.Baseinfo |
| | | var ok bool |
| | | for _, source := range sources { |
| | | |
| | | var tmpinfo protomsg.Baseinfo |
| | | tmpinfo.FaceFeature, ok = source["faceFeature"].(string) |
| | | Isnil("faceFeature", ok) |
| | | tmpinfo.PersonId, ok = source["id"].(string) |
| | |
| | | tmpinfo.Idcard,ok = source["idCard"].(string) |
| | | Isnil("idCard", ok) |
| | | tmpinfo.MonitorLevel,ok = source["monitorLevel"].(string) |
| | | baseinfos = append(baseinfos, tmpinfo) |
| | | baseinfos = append(baseinfos, &tmpinfo) |
| | | } |
| | | return baseinfos |
| | | } |
| | |
| | | } |
| | | |
| | | defer resp.Body.Close() |
| | | |
| | | body, err := ioutil.ReadAll(resp.Body) |
| | | if err != nil { |
| | | fmt.Println(err) |
| | | return nil , err |
| | | } |
| | | |
| | | return body, nil |
| | | } |
| | | |