package exchange

import (
	"context"
	"github.com/zeromicro/go-zero/core/logx"
	"sundynix-micro-go/app/plant/api/internal/svc"
	"sundynix-micro-go/app/plant/api/internal/types"
	plantPb "sundynix-micro-go/app/plant/rpc/plant"
)

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

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

func (l *GetExchangeOrderListLogic) GetExchangeOrderList(req *types.ExchangeOrderListReq) (*plantPb.ExchangeOrderListResp, error) {
	return l.svcCtx.PlantRpc.GetExchangeOrderList(l.ctx, &plantPb.ExchangeOrderListReq{
		UserId: req.UserId, Current: int32(req.Current), PageSize: int32(req.PageSize), Status: int32(req.Status),
	})
}
