import request from '@/utils/request'

/**
 * 获取所有场次
 * @returns
 */
export function getSeckillTime() {
    return request.get(`seckill/time`);
}

/**
 * 获取场次内的商品 
 * @returns
 */
export function getSeckillTimeGoods(params: Record<string, any>) {
    return request.get(`seckill/timeGoods/${params.id}`, params)
}

/**
 * 获取秒杀商品详情
 * @returns
 */
export function getSeckillGoodsDetail(params: Record<string, any>) {
    return request.get(`seckill/goods/detail`, params, { showErrorMessage: true })
}

/**
 * 获取秒杀商品详情弹幕数据
 * @returns
 */
export function getSeckillGoodsBarrage(params: Record<string, any>) {
    return request.get(`seckill/goods/barrage`, params)
}


/**
 * 获取秒杀商品详情弹幕数据
 * @returns
 */
export function getSeckillBuyerInfo(params: Record<string, any>) {
    return request.get(`seckill/goods/buyer`, params)
}



/**
 * 获取秒杀组件商品
 * @returns
 */
export function getSeckillDiyGoods(params: Record<string, any>) {
    return request.get(`seckill/getGoods`, params)
}

/**
 * 获取秒杀组件商品统计
 * @returns
 */
export function getSeckillDiyStatGoods(params: Record<string, any>) {
    return request.get(`seckill/statGoods`, params)
}

/**
 * 获取检查商品核销时间
 * @returns
 */
export function getSeckillGoodsCheckTime(params: Record<string, any>) {
    return request.get(`seckill/goods/check`, params)
}

/**
 * 获取秒杀配置
 * @returns
 */
export function getSeckillConfig() {
    return request.get(`seckill/config`)
}

/**
 * 获取分享关键字
 * @returns
 */
export function getShareKeyword() {
    return request.get(`seckill/getShareKeyword`)
}