import request from "@/utils/request.js";
/**
 *
 * @param {*} data
 * @returns
 */
//按时间分组查询秒杀商品
export function seckillProductGroupAPI(data) {
  return request.post("seckill/product/group", data);
}
export function getProductDetail(id) {
  return request.get(`seckill/product/detail/${id}`);
}
// 秒杀商品预下单
export function seckillOrderPreAPI(data) {
  return request.post(`seckill/order/pre/order`, data);
}
// 加载秒杀预下单信息
export function seckillOrderLoadPreAPI(preOrderNo) {
  return request.get(`seckill/order/load/pre/${preOrderNo}`);
}
// 设置秒杀订单地址和快递费用
export function seckillOrderSetAddressAPI(data) {
  return request.post(`seckill/order/set/address`, data);
}
// 创建秒杀商品订单
export function seckillOrderCreateAPI(data) {
  return request.post(`seckill/order/create`, data);
}
// 秒杀订单支付
export function seckillOrderPaymentAPI(data) {
  return request.post(`seckill/order/payment`, data);
}
// 支付成功回调
export function seckillOrderSuccessfulAPI(data) {
  return request.post(`seckill/order/successful/callback`, data);
}
// 查询用户秒杀订单列表
export function seckillOrderListAPI(data) {
  return request.post(`seckill/order/list`, data);
}
// 回退库存
export function seckillProductSeckillOrdersAPI(id) {
  return request.get(`seckill/product/seckillOrders/${id}`);
}
