grpc.go 547 B

1234567891011121314151617181920212223242526
  1. package bangumi
  2. import (
  3. "context"
  4. seasongrpc "go-common/app/service/openplatform/pgc-season/api/grpc/season/v1"
  5. "github.com/pkg/errors"
  6. )
  7. func (d *Dao) CardsByAids(c context.Context, aids []int64) (res map[int32]*seasongrpc.CardInfoProto, err error) {
  8. var (
  9. tmpAids []int32
  10. )
  11. for _, aid := range aids {
  12. tmpAids = append(tmpAids, int32(aid))
  13. }
  14. arg := &seasongrpc.SeasonAidReq{Aids: tmpAids}
  15. info, err := d.rpcClient.CardsByAids(c, arg)
  16. if err != nil {
  17. err = errors.Wrapf(err, "%v", arg)
  18. return
  19. }
  20. res = info.Cards
  21. return
  22. }