// 场景接口

import serviceAxios from "@/http/index";

// 生成订单
export const generateOrder = (data) => {
  return serviceAxios({
    url: `/vrone/backend/orders/generate`,
    method: "post",
    data,
  });
};

// 支付订单
export const payOrder = (data) => {
  return serviceAxios({
    url: "/vrone/backend/orders/payment",
    method: "put",
    data,
  });
};

// 取消订单
export const cancelOrder = (data) => {
  return serviceAxios({
    url: "/vrone/backend/orders/cancel",
    method: "put",
    data,
  });
};

// 订单退款
export const refundOrder = (data) => {
  return serviceAxios({
    url: "/vrone/backend/orders/refund",
    method: "put",
    data,
  });
};

// 查询用户订单列表
export const listUserOrder = () => {
  return serviceAxios({
    url: "/vrone/backend/orders/listByUserId",
    method: "get",
  });
};

// 查询订单详情
export const getOrderDetail = (data) => {
  return serviceAxios({
    url: "/vrone/backend/orders/" + data,
    method: "get",
  });
};
