import http from "@/http/http.js";
const request = http.request;
const urlType = "market";

/**
 * 限时折扣-分页
 * @param {Object} data
 */
export function limitTimeDiscountPage(data) {
	return request({
		url: `${urlType}/admin/limitTimeDiscount/page`,
		method: "GET",
		data
	});
}

/**
 * 删除限时折扣
 * @param {Object} data
 */
export function limitTimeDiscountDel(id) {
	return request({
		url: `${urlType}/admin/limitTimeDiscount?id=${id}`,
		method: "DELETE"
	});
}

/**
 * 限时折扣-新增/编辑
 * @param {Object} data
 */
export function limitTimeDiscount(data) {
	return request({
		url: `${urlType}/admin/limitTimeDiscount`,
		method: data.id ? 'put' : 'post',
		data
	});
}

/**
 * 限时折扣-分页
 * @param {Object} params
 */
export function couponPage(params) {
	return request({
		url: `${urlType}/admin/coupon/page`,
		method: "GET",
		params
	});
}