setPushSetLogic.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/bxsubscribe"
  5. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/api/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type SetPushSetLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewSetPushSetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SetPushSetLogic {
  15. return &SetPushSetLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *SetPushSetLogic) SetPushSet(req *types.SetPushSetReq) (*types.CommonResp, error) {
  22. // todo: add your logic here and delete this line
  23. res, err := l.svcCtx.Suscribe.SetPushSet(l.ctx, &bxsubscribe.SetPushSetReq{
  24. UserId: req.UserId,
  25. EntId: req.EntId,
  26. EntUserId: req.EntUserId,
  27. PositionType: req.PositionType,
  28. Item: req.Item,
  29. PushType: req.PushType,
  30. PushValue: req.PushValue,
  31. Ratemode: req.Ratemode,
  32. Times: req.Times,
  33. SetType: req.SetType,
  34. Interested: req.Interested,
  35. })
  36. if err != nil {
  37. return &types.CommonResp{
  38. Err_code: res.ErrorCode,
  39. Err_msg: res.ErrorMsg,
  40. Data: nil,
  41. }, nil
  42. }
  43. return &types.CommonResp{
  44. Err_code: res.ErrorCode,
  45. Err_msg: res.ErrorMsg,
  46. Data: nil,
  47. }, nil
  48. }