import request from '@/utils/request'

// 创建用户卡券
export function createCustomerCoupon(data) {
  return request({
    url: '/base/customer-coupon/create',
    method: 'post',
    data: data
  })
}

// 更新用户卡券
export function updateCustomerCoupon(data) {
  return request({
    url: '/base/customer-coupon/update',
    method: 'put',
    data: data
  })
}

// 删除用户卡券
export function deleteCustomerCoupon(id) {
  return request({
    url: '/base/customer-coupon/delete?id=' + id,
    method: 'delete'
  })
}

// 获得用户卡券
export function getCustomerCoupon(id) {
  return request({
    url: '/base/customer-coupon/get?id=' + id,
    method: 'get'
  })
}

// 获得用户卡券分页
export function getCustomerCouponPage(params) {
  return request({
    url: '/base/customer-coupon/page',
    method: 'get',
    params
  })
}
// 导出用户卡券 Excel
export function exportCustomerCouponExcel(params) {
  return request({
    url: '/base/customer-coupon/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
