grpc.go 501 B

12345678910111213141516171819202122
  1. package bangumi
  2. import (
  3. "context"
  4. seasongrpc "go-common/app/service/openplatform/pgc-season/api/grpc/season/v1"
  5. "go-common/library/log"
  6. )
  7. // Cards get bangumis.
  8. func (d *Dao) Cards(ctx context.Context, seasonIds []int32) (res map[int32]*seasongrpc.CardInfoProto, err error) {
  9. arg := &seasongrpc.SeasonInfoReq{
  10. SeasonIds: seasonIds,
  11. }
  12. info, err := d.rpcClient.Cards(ctx, arg)
  13. if err != nil {
  14. log.Error("d.rpcClient.Cards error(%v)", err)
  15. return nil, err
  16. }
  17. res = info.Cards
  18. return
  19. }