viewStatusLogic.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package logic
  2. import (
  3. "context"
  4. "jyBXSubscribe/rpc/type/bxsubscribe"
  5. "jyBXSubscribe/api/internal/svc"
  6. "jyBXSubscribe/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type ViewStatusLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewViewStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ViewStatusLogic {
  15. return &ViewStatusLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *ViewStatusLogic) ViewStatus(req *types.ViewStatusReq) (resp *types.CommonResp, err error) {
  22. // todo: add your logic here and delete this line
  23. res, err := l.svcCtx.Suscribe.GetViewStatus(l.ctx, &bxsubscribe.GetViewStatusReq{
  24. AppId: req.AppId,
  25. EntId: req.EntId,
  26. EntUserId: req.EntUserId,
  27. InfoId: req.InfoId,
  28. })
  29. if err != nil {
  30. return &types.CommonResp{
  31. Err_code: res.ErrCode,
  32. Err_msg: res.ErrMsg,
  33. Data: nil,
  34. }, nil
  35. }
  36. return &types.CommonResp{
  37. Err_code: res.ErrCode,
  38. Err_msg: res.ErrMsg,
  39. Data: res,
  40. }, nil
  41. return
  42. }