import request from '@/utils/request'

// 查询优惠券列表
export function listMallCoupon(query) {
  return request({
    url: '/mall/mallCoupon/list',
    method: 'get',
    params: query
  })
}

// 查询优惠券详细
export function getMallCoupon(id) {
  return request({
    url: '/mall/mallCoupon/' + id,
    method: 'get'
  })
}

// 新增优惠券
export function addMallCoupon(data) {
  return request({
    url: '/mall/mallCoupon',
    method: 'post',
    data: data
  })
}

// 修改优惠券
export function updateMallCoupon(data) {
  return request({
    url: '/mall/mallCoupon',
    method: 'put',
    data: data
  })
}

// 删除优惠券
export function delMallCoupon(id) {
  return request({
    url: '/mall/mallCoupon/' + id,
    method: 'delete'
  })
}

// 导出优惠券
export function exportMallCoupon(query) {
  return request({
    url: '/mall/mallCoupon/export',
    method: 'get',
    params: query
  })
}