import { request } from 'umi';

/** 获取优惠卷  sdsa GET /kitchen/api/coupon/couponpgage */
export async function GetCouponList(data) {
  return request(`/kitchen/api/coupon/couponpgage`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}
/** 新增优惠卷 POST /kitchen/api/coupon/addCoupon */

export async function Addcoupon(data) {
  // http://localhost:7002
  return request('/kitchen/api/coupon/addCoupon', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
}

/** 删除优惠卷 POST /kitchen/api/coupon/deleteCoupon */

export async function DeleteCoupon(data) {
  // http://localhost:7002
  return request('/kitchen/api/coupon/deleteCoupon', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
}

/** 修改优惠卷 POST /kitchen/api/coupon/updateCoupon */

export async function UpdateCoupon(data) {
  // http://localhost:7002
  return request('/kitchen/api/coupon/updateCoupon', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
}

/** 作废优惠卷 POST /kitchen/api/coupon/abolish-coupon */
export async function abolishCoupon(id) {
  return request(`/kitchen/api/coupon/abolish-coupon/${id}`, {
    method: 'POST',
    // data: data,
    // ...(options || {}),
  });
}

/** 获取优惠卷状态或类型  sdsa GET //kitchen/api/coupon/coupon-status-or-type/{type} */
export async function GetCouponStatusOrType(data) {
  return request(`/kitchen/api/coupon/getCouponStatusOrType`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}

//添加优惠券记录
export async function AddCouponSendRecord(data) {
  return request('/kitchen/api/coupon/couponsendrecord', {
    method: 'put',
    data: data,
  });
}

//添加优惠券记录
export async function UpdateCouponStatus(data) {
  return request('/kitchen/api/coupon/coupon-status', {
    method: 'put',
    data: data,
  });
}



