import http from '@/http/http.js'
const request = http.request

/**
 * 店铺优惠券列表
 * @returns
 */
export function getCouponList(data, urlType = 'account') {
	return request({
		url: `${urlType}/admin/coupon`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 生成订单后使用
 * @returns
 */
export function getFindCoupon(data, urlType = 'account') {
	return request({
		url: `${urlType}/admin/coupon/findCoupon`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 店铺优惠券新增
 * @returns
 */
export function addCoupon(data, urlType = 'account') {
	return request({
		url: `${urlType}/admin/coupon`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 店铺优惠券修改
 * @returns
 */
export function updateCoupon(data, urlType = 'account') {
	return request({
		url: `${urlType}/admin/coupon`,
		method: "PUT",
		data: {
			...data
		}
	})
}
