You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
713 B
32 lines
713 B
package dao |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/app/admin/main/coupon/model" |
|
seasongrpc "go-common/app/service/openplatform/pgc-season/api/grpc/season/v1" |
|
|
|
"github.com/pkg/errors" |
|
) |
|
|
|
//GetPGCInfo get pgc info. |
|
func (d *Dao) GetPGCInfo(c context.Context, oid int32) (r *model.PGCInfoResq, err error) { |
|
var ( |
|
params *seasongrpc.SeasonInfoReq |
|
oids = make([]int32, 0) |
|
reply *seasongrpc.CardsInfoReply |
|
) |
|
oids = append(oids, oid) |
|
params = &seasongrpc.SeasonInfoReq{ |
|
SeasonIds: oids, |
|
} |
|
if reply, err = d.rpcClient.Cards(c, params); err != nil { |
|
err = errors.WithStack(err) |
|
return |
|
} |
|
if proto, success := reply.Cards[oid]; success { |
|
r = new(model.PGCInfoResq) |
|
r.Title = proto.Title |
|
} |
|
return |
|
}
|
|
|