import request from "@/utils/request.js";

/**
 * 获取提现记录列表
 */
export function getWithdrawList(data) {
	return request.get('extract/record2', data);
}

/**
 * 获取充值记录列表
 */
export function getRechargeList(data) {
	return request.get('recharge/list', data);
}

/**
 * 获取充值的金额列表
 */
export function getAmountList(data) {
	return request.get('recharge/index', data);
}

/**
 * 获取消费记录列表
 */
export function getConsumeList(data) {
	return request.get('infobycondition', data);
}

/**
 * 获取贵金属余额
 */
export function getMetalBalance(data) {
	return request.get('goldbalance/getBalance', data);
}

/**
 * 充值预下单
 */
export function rechargeOrder(data) {
	return request.post('recharge/wechat-alipay', data);
}

/**
 * 买金
 */
export function buyGold(data) {
	return request.post('goldprincipal/buy', data);
}

/**
 * 每日一攒次数获取
 */
export function accumulateCount(data) {
	return request.post('goldprincipal/selectcount', data);
}

/**
 * 直播换款
 */
export function liveExchange(data) {
	return request.post('goldprincipal/changestyle', data);
}

/**
 * 买卖金交易明细列表
 */
export function goldTradelist(data) {
	return request.get('goldprincipal/list', data);
}

/**
 * 设置金价预警
 */
export function setGoldAlert(data) {
	return request.post('goldwarning/create', data);
}

/**
 * 获取金价预警记录
 */
export function getGoldAlertList(data) {
	return request.get('goldwarning/list', data);
}

/**
 * 删除金价预警记录
 */
export function deleteGoldAlert(data) {
	return request.get('goldwarning/delete', data);
}

/**
 * 每日一攒 列表
 */
export function goldprincipalList2(data) {
	return request.get('goldprincipal/list2', data);
}

/**
 * 创建预约
 */
export function createReservation(data) {
	return request.post("plate-reservation/create", data);
}

/**
 * 查询预约
 */
export function getReservationDetail(reservationId) {
	return request.get(`plate-reservation/detail/${reservationId}`);
}
/**
 * 提料 预约订单列表
 */
export function getMyReservations(data) {
	return request.get("plate-reservation/my-reservations", data);
}
/**
 * 提料 订单列表
 */
export function getMetalOrderList(data) {
	return request.get("goldprincipal/plate-exchange-orders", data);
}
/**
 * 取消预约
 * @param {number} reservationId - 预约ID
 */
export function cancelReservation(reservationId) {
	return request.post(`plate-reservation/cancel/${reservationId}`);
}
/**
 * 新 - 提料兑换订单
 */
export function nest_exchangeMetalOrder(data) {
	return request.post("goldprincipal/plate-exchange2", data);
}
/**
 * 根据克重和金属类型查询可预约时间
 */
export function quotaByWeight(data) {
	return request.get("plate-reservation/quotaByWeight", data);
}