import { request } from 'umi';
import { getDataBaseUrl,getStoremanagement } from '@/global_data';

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

export async function AddPaperCoupon(data) {
  // http://localhost:7002
  return request(getStoremanagement()+'/api/papercoupon/addPaperCoupon', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
}

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

export async function DeletePaperCoupon(data) {
  // http://localhost:7002
  return request(getStoremanagement()+'/api/papercoupon/updatePaperCouponEnable?Ids='+data, {
    method: 'GET',
    // type:'json',
    //data: data,
    // ...(options || {}),
  });
}

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

export async function UpdatePaperCoupon(data) {
  // http://localhost:7002
  return request(getStoremanagement()+'/api/papercoupon/updatePaperCoupon', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
  
}
/** 获取优惠卷类型  sdsa GET //kitchen/api/coupon/coupon-status-or-type/{type} */
export async function GetPaperCouponType() {
    return request(getStoremanagement()+`/api/papercoupon/getPaperCouponType`, {
      method: 'GET',
      //data: null,
      // params: { ...params },
      // ...(options || {}),
    });
  }
  /** 添加优惠卷类型 */
  export async function AddPaperCouponType(data) {
    // http://localhost:7002
    return request(getStoremanagement()+'/api/papercoupon/addPaperCouponType', {
      method: 'POST',
      // type:'json',
      data: data,
      // ...(options || {}),
    });
  }
  