import request from '@/utils/request'

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

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

// 查询优惠券详细
export function getTypeList() {
  return request({
    url: '/system/Coupons/getTypeList',
    method: 'get'
  })
}


// 任务状态修改
export function changetypeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/Coupons/changeStatus',
    method: 'put',
    data: data
  })
}
// 新增优惠券
export function addCoupons(data) {
  return request({
    url: '/system/Coupons',
    method: 'post',
    data: data
  })
}

// 修改优惠券
export function updateCoupons(data) {
  return request({
    url: '/system/Coupons',
    method: 'put',
    data: data
  })
}

// 删除优惠券
export function delCoupons(id) {
  return request({
    url: '/system/Coupons/' + id,
    method: 'delete'
  })
}
