package card_info_jd

import (
	"context"
	"kami/api/commonApi"
	"kami/internal/model"
	"kami/internal/service"

	"kami/api/card_info_jd/v1"
)

func (c *ControllerV1) JDAccountWalletList(ctx context.Context, req *v1.JDAccountWalletListReq) (res *v1.JDAccountWalletListRes, err error) {
	total, data, err := service.CardRedeemAccount().GetWalletHistory(ctx, &model.RedeemAccountHistoryQueryInput{
		CommonPageReq: commonApi.CommonPageReq{
			Current:  req.Current,
			PageSize: req.PageSize,
		},
		AccountId: req.AccountId,
	})
	res = &v1.JDAccountWalletListRes{}
	res.List = data
	res.Total = total
	return
}
