package card_info_walmart

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

	"kami/api/card_info_walmart/v1"
)

func (c *ControllerV1) AccountWalletList(ctx context.Context, req *v1.AccountWalletListReq) (res *v1.AccountWalletListRes, 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.AccountWalletListRes{}
	res.List = data
	res.Total = total
	return
}
