mypublishdetaillogic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package logic
  2. import (
  3. "context"
  4. "jyInfo/rpc/consumer/consumer"
  5. "app.yhyue.com/moapp/jybase/common"
  6. "jyInfo/api/internal/svc"
  7. "jyInfo/api/internal/types"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type MyPublishDetailLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewMyPublishDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MyPublishDetailLogic {
  16. return &MyPublishDetailLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *MyPublishDetailLogic) MyPublishDetail(req *types.MyPublishCommonReq) (resp *types.CommonRes, err error) {
  23. publishDetial, err0 := l.svcCtx.Consumer.InfoChange(l.ctx, &consumer.InfoDetailReq{
  24. UserId: req.UserId,
  25. MsgId: req.MsgId,
  26. Type: common.Int64All(req.Type),
  27. MsgType: common.Int64All(req.MsgType),
  28. })
  29. if err0 != nil {
  30. return &types.CommonRes{
  31. Err_code: -1,
  32. Err_msg: "错误",
  33. Data: nil,
  34. }, nil
  35. }
  36. return &types.CommonRes{
  37. Err_code: common.IntAll(publishDetial.ErrCode),
  38. Err_msg: publishDetial.ErrMsg,
  39. Data: publishDetial.Results,
  40. }, nil
  41. }