package card_info_t_mall_game

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

	"github.com/gogf/gf/v2/os/glog"
	"github.com/jinzhu/copier"

	"kami/api/card_info_t_mall_game/v1"
)

func (c *ControllerV1) TMallGameShopOrderList(ctx context.Context, req *v1.TMallGameShopOrderListReq) (res *v1.TMallGameShopOrderListRes, err error) {
	res = &v1.TMallGameShopOrderListRes{}
	total, result, err := service.RechargeTMallGameOrder().ShopList(ctx, &model.RechargeTMallGameShopOrderListInput{
		TMallGameShopOrderListReq: req,
	})
	res.Total = total
	err2 := copier.CopyWithOption(&res.List, &result, copier.Option{IgnoreEmpty: true, DeepCopy: true})
	if err2 != nil {
		glog.Error(ctx, "复制数据失败", err2)
	}
	return
}
