setReadLogic.go 1.3 KB

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