setPushSetLogic.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package logic
  2. import (
  3. "context"
  4. "jyBXSubscribe/rpc/bxsubscribe"
  5. "jyBXSubscribe/api/internal/svc"
  6. "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. })
  35. if err != nil {
  36. return &types.CommonResp{
  37. Err_code: res.ErrorCode,
  38. Err_msg: res.ErrorMsg,
  39. Data: nil,
  40. }, nil
  41. }
  42. return &types.CommonResp{
  43. Err_code: res.ErrorCode,
  44. Err_msg: res.ErrorMsg,
  45. Data: res,
  46. }, nil
  47. }