import request from '@/utils/request'

// 查询优惠券中心列表
export function listCoupon(query) {
  return request({
    url: '/business/coupon/list',
    method: 'get',
    params: query
  })
}

// 查询优惠券中心详细
export function getCoupon(id) {
  return request({
    url: '/business/coupon/' + id,
    method: 'get'
  })
}

// 新增优惠券中心
export function addCoupon(data) {
  return request({
    url: '/business/coupon',
    method: 'post',
    data: data
  })
}

// 修改优惠券中心
export function updateCoupon(data) {
  return request({
    url: '/business/coupon',
    method: 'put',
    data: data
  })
}

// 删除优惠券中心
export function delCoupon(id) {
  return request({
    url: '/business/coupon/' + id,
    method: 'delete'
  })
}

// 导出优惠券中心
export function exportCoupon(query) {
  return request({
    url: '/business/coupon/export',
    method: 'get',
    params: query
  })
}