import request from '@/utils/request'

// 创建基础卡券
export function createCoupon(data) {
  return request({
    url: '/member/coupon/create',
    method: 'post',
    data: data
  })
}

// 复制附属权益
export function copyCoupon(data) {
  return request({
    url: '/member/coupon/copy',
    method: 'post',
    data: data
  })
}

// 更新基础卡券
export function updateCoupon(data) {
  return request({
    url: '/member/coupon/update',
    method: 'put',
    data: data
  })
}

// 删除基础卡券
export function deleteCoupon(id) {
  return request({
    url: '/member/coupon/delete?id=' + id,
    method: 'delete'
  })
}

// 获得基础卡券
export function getCoupon(id) {
  return request({
    url: '/member/coupon/get?id=' + id,
    method: 'get'
  })
}

// 获得基础卡券分页
export function getCouponPage(params) {
  return request({
    url: '/member/coupon/page',
    method: 'get',
    params
  })
}
// 导出基础卡券 Excel
export function exportCouponExcel(params) {
  return request({
    url: '/member/coupon/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
