mypublishdetaillogic.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
  4. "context"
  5. "log"
  6. "app.yhyue.com/moapp/jybase/common"
  7. "app.yhyue.com/moapp/jyInfo/api/internal/svc"
  8. "app.yhyue.com/moapp/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, &consumerclient.InfoDetailReq{
  25. UserId: req.UserId,
  26. MsgId: req.MsgId,
  27. Type: common.Int64All(req.Type),
  28. MsgType: req.MsgType,
  29. AppId: req.AppId,
  30. })
  31. if err0 != nil {
  32. return &types.CommonRes{
  33. Err_code: -1,
  34. Err_msg: "错误",
  35. Data: nil,
  36. }, nil
  37. }
  38. log.Println("publishDetial.Results:", publishDetial.Results)
  39. return &types.CommonRes{
  40. Err_code: common.IntAll(publishDetial.ErrCode),
  41. Err_msg: publishDetial.ErrMsg,
  42. Data: publishDetial.Results,
  43. }, nil
  44. }