setReadLogic.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 SetReadLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewSetReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SetReadLogic {
  15. return &SetReadLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *SetReadLogic) SetRead(req *types.SetReadReq) (resp *types.CommonResp, err error) {
  22. // todo: add your logic here and delete this line
  23. res, err := l.svcCtx.Suscribe.SetRead(l.ctx, &bxsubscribe.SetReadReq{
  24. AppId: req.AppId,
  25. UserType: req.UserType,
  26. UserId: req.UserId,
  27. NewUserId: req.NewUserId,
  28. EntId: req.EntId,
  29. IsEnt: req.IsEnt,
  30. EntUserId: req.EntUserId,
  31. })
  32. if err != nil {
  33. return &types.CommonResp{
  34. Err_code: res.ErrorCode,
  35. Err_msg: res.ErrorMsg,
  36. Data: nil,
  37. }, nil
  38. }
  39. return &types.CommonResp{
  40. Err_code: res.ErrorCode,
  41. Err_msg: res.ErrorMsg,
  42. Data: nil,
  43. }, nil
  44. return
  45. }