package card_info_t_mall_game

import (
	"context"
	"kami/internal/errHandler"
	"kami/internal/service"
	"kami/utility/utils"

	"kami/api/card_info_t_mall_game/v1"

	"github.com/gogf/gf/v2/errors/gcode"
)

func (c *ControllerV1) TMallGameShopOrderHistory(ctx context.Context, req *v1.TMallGameShopOrderHistoryReq) (res *v1.TMallGameShopOrderHistoryRes, err error) {
	res = new(v1.TMallGameShopOrderHistoryRes)
	result, err := service.RechargeTMallGameOrder().GetHistoryList(ctx, req.OrderNo)
	err = errHandler.WrapError(ctx, gcode.CodeNotFound, utils.HandleNoRowsError(err), "订单历史不存在")
	res.List = result
	return
}
