| | |
| | | "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 |
| | | } |
| | | |