import request from '@/utils/request'

// 查询优惠劵列表
export function listInfo(query) {
  return request({
    url: '/coupon/info/list',
    method: 'get',
    params: query
  })
}

// 查询优惠劵详细
export function getInfo(id) {
  return request({
    url: '/coupon/info/' + id,
    method: 'get'
  })
}

// 新增优惠劵
export function addInfo(data) {
  return request({
    url: '/coupon/info',
    method: 'post',
    data: data
  })
}

// 修改优惠劵
export function updateInfo(data) {
  return request({
    url: '/coupon/info',
    method: 'put',
    data: data
  })
}

// 删除优惠劵
export function delInfo(id) {
  return request({
    url: '/coupon/info/' + id,
    method: 'delete'
  })
}

// 导出优惠劵
export function exportInfo(query) {
  return request({
    url: '/coupon/info/export',
    method: 'get',
    params: query
  })
}