package logic

import (
	"context"
	"jyBXCore/rpc/type/bxcore"

	"jyBXCore/api/internal/svc"
	"jyBXCore/api/internal/types"

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

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

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

func (l *PolymerizeSearchLogic) PolymerizeSearch(req *types.PolymerizeSearchReq) (resp *types.CommonResp, err error) {
	// todo: add your logic here and delete this line
	res, err := l.svcCtx.BxCore.PolymerizeSearch(l.ctx, &bxcore.PolymerizeSearchReq{
		EntId:        req.EntId,
		PositionId:   req.PositionId,
		AccountId:    req.AccountId,
		AppId:        req.AppId,
		SearchCode:   req.SearchCode,
		PositionType: req.PositionType,
		UserId:       req.UserId,
		NewUserId:    req.NewUserId,
		EntAccountId: req.EntAccountId,
		EntUserId:    req.EntUserId,
	})
	if err != nil {
		return nil, err
	}
	return &types.CommonResp{
		Data: res.Data,
	}, nil
}
