import request from '@/utils/request'

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

// 查询优惠券详细
export function getStoreCoupon(couponId) {
  return request({
    url: '/store/storeCoupon/' + couponId,
    method: 'get'
  })
}

// 新增优惠券
export function addStoreCoupon(data) {
  return request({
    url: '/store/storeCoupon',
    method: 'post',
    data: data
  })
}
export function publishCoupon(data) {
  return request({
    url: '/store/storeCoupon/publish',
    method: 'post',
    data: data
  })
}

export function batchPublishCoupon(data) {
  return request({
    url: '/store/storeCoupon/batchPublish',
    method: 'post',
    data: data
  })
}



// 修改优惠券
export function updateStoreCoupon(data) {
  return request({
    url: '/store/storeCoupon',
    method: 'put',
    data: data
  })
}

// 删除优惠券
export function delStoreCoupon(couponId) {
  return request({
    url: '/store/storeCoupon/' + couponId,
    method: 'delete'
  })
}

// 导出优惠券
export function exportStoreCoupon(query) {
  return request({
    url: '/store/storeCoupon/export',
    method: 'get',
    params: query
  })
}
