advertisingexposurelogic.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyMarketing/rpc/activity"
  4. "context"
  5. "app.yhyue.com/moapp/jyMarketing/api/internal/svc"
  6. "app.yhyue.com/moapp/jyMarketing/api/internal/types"
  7. "github.com/tal-tech/go-zero/core/logx"
  8. )
  9. type AdvertisingExposureLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewAdvertisingExposureLogic(ctx context.Context, svcCtx *svc.ServiceContext) AdvertisingExposureLogic {
  15. return AdvertisingExposureLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *AdvertisingExposureLogic) AdvertisingExposure(req types.AdvertisingReq) (*types.Response, error) {
  22. // todo: add your logic here and delete this line
  23. result := &types.Response{}
  24. resp, err :=l.svcCtx.Activity.AdvertisingExposure(l.ctx,&activity.AdvertisingReq{
  25. UserID: req.UserID,
  26. Client: req.Client,
  27. AdvertisingID: req.AdvertisingID,
  28. AdvertisingUrl: req.AdvertisingUrl,
  29. })
  30. if err != nil {
  31. return nil, err
  32. }
  33. result.Code = resp.Code
  34. result.Message = resp.Message
  35. return result, nil
  36. }