derivedellogic.go 919 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package logic
  2. import (
  3. "context"
  4. "jyBXSubscribe/api/internal/svc"
  5. "jyBXSubscribe/api/internal/types"
  6. "jyBXSubscribe/rpc/type/bxsubscribe"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type DeriveDelLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewDeriveDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeriveDelLogic {
  15. return &DeriveDelLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *DeriveDelLogic) DeriveDel(req *types.DeriveReq) (resp *types.CommonResp, err error) {
  22. res, err := l.svcCtx.Suscribe.DeriveDel(l.ctx, &bxsubscribe.DeriveReq{
  23. InfoId: req.InfoId,
  24. })
  25. if err != nil {
  26. return &types.CommonResp{
  27. Err_code: res.ErrorCode,
  28. Err_msg: res.ErrorMsg,
  29. Data: nil,
  30. }, nil
  31. }
  32. return &types.CommonResp{
  33. Err_code: res.ErrorCode,
  34. Err_msg: res.ErrorMsg,
  35. Data: res.Status,
  36. }, nil
  37. return
  38. }