buyerSupplyInfoLogic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. return &types.CommonResp{
  23. Err_code: 0,
  24. Err_msg: "",
  25. Data: "",
  26. }, nil
  27. res, err0 := l.svcCtx.Buyer.BuyerSupplyInfo(l.ctx, &bxbuyer.BuyerSupplyInfoReq{
  28. Buyers: req.Buyer,
  29. PositionId: req.PositionId,
  30. PositionType: req.PositionType,
  31. Phone: req.Phone,
  32. })
  33. if err0 != nil {
  34. return &types.CommonResp{
  35. Err_code: -1,
  36. Err_msg: "错误",
  37. Data: nil,
  38. }, nil
  39. }
  40. return &types.CommonResp{
  41. Err_code: res.ErrCode,
  42. Err_msg: res.ErrMsg,
  43. Data: res.Data,
  44. }, nil
  45. }