import request from '@/utils/request';

export function getCouponList(params: any) {
  return request({ url: '/api/admin/coupons', method: 'GET', params });
}

export function getCouponDetail(id: number) {
  return request({ url: `/api/admin/coupons/${id}`, method: 'GET' });
}

export function createCoupon(data: any) {
  return request({ url: '/api/admin/coupons', method: 'POST', data });
}

export function updateCoupon(id: number, data: any) {
  return request({ url: `/api/admin/coupons/${id}`, method: 'PUT', data });
}

export function deleteCoupon(id: number) {
  return request({ url: `/api/admin/coupons/${id}`, method: 'DELETE' });
}
