buyerSupplyInfoLogic.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package logic
  2. import (
  3. "context"
  4. "jyBXBuyer/rpc/type/bxbuyer"
  5. "jyBXBuyer/api/internal/svc"
  6. "jyBXBuyer/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type BuyerSupplyInfoLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewBuyerSupplyInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BuyerSupplyInfoLogic {
  15. return &BuyerSupplyInfoLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *BuyerSupplyInfoLogic) BuyerSupplyInfo(req *types.BuyerSupplyInfoReq) (resp *types.CommonResp, err error) {
  22. res, err0 := l.svcCtx.Buyer.BuyerSupplyInfo(l.ctx, &bxbuyer.BuyerSupplyInfoReq{
  23. Buyers: req.Buyer,
  24. PositionId: req.PositionId,
  25. PositionType: req.PositionType,
  26. Phone: req.Phone,
  27. })
  28. if err0 != nil {
  29. return &types.CommonResp{
  30. Err_code: -1,
  31. Err_msg: "错误",
  32. Data: nil,
  33. }, nil
  34. }
  35. return &types.CommonResp{
  36. Err_code: res.ErrCode,
  37. Err_msg: res.ErrMsg,
  38. Data: res.Data,
  39. }, nil
  40. }