package logic

import (
	"context"
	"jyBXBuyer/rpc/type/bxbuyer"

	"jyBXBuyer/api/internal/svc"
	"jyBXBuyer/api/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type BuyerSupplyInfoLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewBuyerSupplyInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BuyerSupplyInfoLogic {
	return &BuyerSupplyInfoLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *BuyerSupplyInfoLogic) BuyerSupplyInfo(req *types.BuyerSupplyInfoReq) (resp *types.CommonResp, err error) {
	return &types.CommonResp{
		Err_code: 0,
		Err_msg:  "",
		Data:     "",
	}, nil

	res, err0 := l.svcCtx.Buyer.BuyerSupplyInfo(l.ctx, &bxbuyer.BuyerSupplyInfoReq{
		Buyers:       req.Buyer,
		PositionId:   req.PositionId,
		PositionType: req.PositionType,
		Phone:        req.Phone,
	})
	if err0 != nil {
		return &types.CommonResp{
			Err_code: -1,
			Err_msg:  "错误",
			Data:     nil,
		}, nil
	}
	return &types.CommonResp{
		Err_code: res.ErrCode,
		Err_msg:  res.ErrMsg,
		Data:     res.Data,
	}, nil
}
