import request from "@/utils/request";

// 查询列表
export function listCoupon(data) {
  return request({
    url: "/coupon/list",
    method: "post",
    data: data,
  });
}


// 新增
export function addCoupon(data) {
  return request({
    url: "/coupon",
    method: "put",
    data: data,
  });
}

// 修改
export function updateClass(data) {
  return request({
    url: "/system/category",
    method: "put",
    data: data,
  });
}

// 删除
export function delCoupon(id) {
  return request({
    url: "/coupon/" + id,
    method: "delete",
  });
}

// 下架
export function offlineCoupon(id) {
  return request({
    url: "/coupon/offline/" + id,
    method: "get",
  });
}

// 上架
export function onlineCoupon(id) {
  return request({
    url: "/coupon/online/" + id,
    method: "get",
  });
}

// 用户领取优惠券列表
export function getCouponInfoList(data) {
  return request({
    url: "/coupon-user/list",
    method: "post",
    data: data,
  });
}

