deriveshowlogic.go 971 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 DeriveShowLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewDeriveShowLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeriveShowLogic {
  15. return &DeriveShowLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *DeriveShowLogic) DeriveShow(req *types.DeriveReq) (resp *types.CommonResp, err error) {
  22. res, err := l.svcCtx.Suscribe.DeriveShow(l.ctx, &bxsubscribe.DeriveReq{
  23. EntId: req.EntId,
  24. EntUserId: req.EntUserId,
  25. UserId: req.UserId,
  26. })
  27. if err != nil {
  28. return &types.CommonResp{
  29. Err_code: res.ErrCode,
  30. Err_msg: res.ErrMsg,
  31. Data: nil,
  32. }, nil
  33. }
  34. return &types.CommonResp{
  35. Err_code: res.ErrCode,
  36. Err_msg: res.ErrMsg,
  37. Data: res.Data,
  38. }, nil
  39. return
  40. }