import request from "@/utils/request";
import { Market_BaseUrl } from "@/api/config";
const baseURL = Market_BaseUrl + "/admin/coupon";
const API = {
	getList(params : any) {
		return request<any>({
			url: `${baseURL}/page`,
			method: "get",
			params
		});
	},
	//优惠券列表/已领取详情
	getDetail(params : any) {
		return request<any>({
			url: `${baseURL}/record`,
			method: "get",
			params
		});
	},
	// 删除用户优惠券
	delete(params : any) {
		return request({
			url: `${baseURL}/deleteRecord`,
			method: "delete",
			params,
		});
	},
	//优惠券发放
	giveCoupon(data : any) {
		return request<any>({
			url: `${baseURL}/grant`,
			method: "post",
			data
		});
	},
	//优惠券发放
	getRecordByUser(params : any) {
		return request<any>({
			url: `${baseURL}/getRecordByUser`,
			method: "get",
			params
		});
	},
}
export default API;