add apis
This commit is contained in:
@@ -48,3 +48,20 @@ func GetStore(id int64, name string) dao.StoreInfo {
|
||||
|
||||
return storeInfo
|
||||
}
|
||||
|
||||
func GetStores(ids []int64, name string) []*store.InfoResponse {
|
||||
cli, err := GetRpcClient(name)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return nil
|
||||
}
|
||||
|
||||
client := store.NewStoreClient(cli.Conn())
|
||||
items, err := client.GetInfoByIds(context.Background(), &store.IdsRequest{Ids: ids})
|
||||
if err != nil {
|
||||
logx.Errorf("get store err: %v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
return items.Items
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user