| | |
| | | |
| | | import ( |
| | | "errors" |
| | | "fmt" |
| | | "strconv" |
| | | "strings" |
| | | |
| | | "basic.com/pubsub/protomsg.git" |
| | | ) |
| | |
| | | } |
| | | |
| | | // 根据底库id查询底库信息 |
| | | func Dbtablefosbyid(id string) (protomsg.Dbtable, error) { |
| | | var dbinfo protomsg.Dbtable |
| | | |
| | | func Dbtablefosbyid (id []string) ([]protomsg.Dbtable, error) { |
| | | var dbinfo []protomsg.Dbtable |
| | | dbtableId := strings.Replace(strings.Trim(fmt.Sprint(id), "[]"), " ", "\",\"", -1) |
| | | var dbinfoRequest = ` |
| | | { |
| | | "query": { |
| | |
| | | "filter": [{ |
| | | "terms": { |
| | | "_id": [ |
| | | "` + id + `" |
| | | "`+ dbtableId +`" |
| | | ] |
| | | } |
| | | }] |
| | |
| | | } |
| | | |
| | | // 根据底库人员id查询底库人员信息 |
| | | func Dbpersoninfosbyid(id string) (protomsg.Dbperson, error) { |
| | | var dbinfo protomsg.Dbperson |
| | | |
| | | func Dbpersoninfosbyid (id []string) ([]protomsg.Dbperson, error) { |
| | | var dbinfo []protomsg.Dbperson |
| | | dbtablePersonId := strings.Replace(strings.Trim(fmt.Sprint(id), "[]"), " ", "\",\"", -1) |
| | | var dbinfoRequest = ` |
| | | { |
| | | "query": { |
| | |
| | | "filter": [{ |
| | | "terms": { |
| | | "_id": [ |
| | | "` + id + `" |
| | | "`+ dbtablePersonId +`" |
| | | ] |
| | | } |
| | | }] |
| | |
| | | } |
| | | |
| | | dbperson := Dbpersonbyid(sources) |
| | | println(dbperson) |
| | | return dbperson, nil |
| | | } |
| | | |