welfare.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package vip
  2. import (
  3. "context"
  4. "go-common/app/service/main/vip/api"
  5. "go-common/library/log"
  6. )
  7. // WelfareList get welfare list
  8. func (s *Service) WelfareList(c context.Context, tid, recommend, pn, ps int64) (res *v1.WelfareReply, err error) {
  9. welfareReq := &v1.WelfareReq{Tid: tid, Recommend: recommend, Ps: ps, Pn: pn}
  10. if res, err = s.vipgRPC.WelfareList(c, welfareReq); err != nil {
  11. log.Error("vipSvc.WelfareList(%+v) err(%+v)", welfareReq, err)
  12. }
  13. return
  14. }
  15. // WelfareTypeList get welfare type list
  16. func (s *Service) WelfareTypeList(c context.Context) (res *v1.WelfareTypeReply, err error) {
  17. welfareTypeReq := &v1.WelfareTypeReq{}
  18. if res, err = s.vipgRPC.WelfareTypeList(c, welfareTypeReq); err != nil {
  19. log.Error("vipSvc.WelfareTypeList err(%+v)", err)
  20. }
  21. return
  22. }
  23. // WelfareInfo get welfare info
  24. func (s *Service) WelfareInfo(c context.Context, wid, mid int64) (res *v1.WelfareInfoReply, err error) {
  25. welfareInfoReq := &v1.WelfareInfoReq{Id: wid, Mid: mid}
  26. if res, err = s.vipgRPC.WelfareInfo(c, welfareInfoReq); err != nil {
  27. log.Error("vipSvc.WelfareInfo(%+v) err(%+v)", wid, err)
  28. }
  29. return
  30. }
  31. // WelfareReceive receive welfare
  32. func (s *Service) WelfareReceive(c context.Context, wid, mid int64) (res *v1.WelfareReceiveReply, err error) {
  33. welfareReceiveReq := &v1.WelfareReceiveReq{Wid: wid, Mid: mid}
  34. if res, err = s.vipgRPC.WelfareReceive(c, welfareReceiveReq); err != nil {
  35. log.Error("vipSvc.WelfareReceive(%+v) err(%+v)", wid, err)
  36. }
  37. return
  38. }
  39. // MyWelfare get my welfare
  40. func (s *Service) MyWelfare(c context.Context, mid int64) (res *v1.MyWelfareReply, err error) {
  41. myWelfareReq := &v1.MyWelfareReq{Mid: mid}
  42. if res, err = s.vipgRPC.MyWelfare(c, myWelfareReq); err != nil {
  43. log.Error("vipSvc.MyWelfare err(%+v)", err)
  44. }
  45. return
  46. }