supplyinfodetaillogic.go 1.1 KB

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