mypublishdetaillogic.go 1.2 KB

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