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) TMallGameShopOrderGetOne(ctx context.Context, req *v1.TMallGameShopOrderGetOneReq) (res *v1.TMallGameShopOrderGetOneRes, err error) {
	result, err := service.RechargeTMallGameOrder().GetShopOrderByOrderNo(ctx, req.OrderNo, nil)
	err = utils.HandleNoRowsError(err)
	err = errHandler.WrapError(ctx, gcode.CodeNotFound, err, "订单不存在")
	res = &v1.TMallGameShopOrderGetOneRes{
		V1RechargeTMallShop: *result,
	}
	return
}
