import http from "@/http/http.js";
const request = http.request;
const urlType = "market";

export function enable(params) {
  return request({
    url: urlType + `/admin/couponRedemption/enable`,
    method: "PUT",
    params: {
      ...params,
    },
  });
}

export function status(params) {
  return request({
    url: urlType + `/admin/couponRedemption/enable/status`,
    method: "get",
    params: {
      ...params,
    },
  });
}
export function couponRedemption(params) {
  return request({
    url: urlType + `/admin/couponRedemption`,
    method: "get",
    params: {
      ...params,
    },
  });
}
export function couponRedemptionList(params) {
  return request({
    url: urlType + `/admin/couponRedemption/list`,
    method: "get",
    params: {
      ...params,
    },
  });
}
export function add(params) {
  return request({
    url: urlType + `/admin/couponRedemption`,
    method: "POST",
    params: {
      ...params,
    },
  });
}
export function edit(params) {
  return request({
    url: urlType + `/admin/couponRedemption`,
    method: "PUT",
    params: {
      ...params,
    },
  });
}
export function codeList(params) {
  return request({
    url: urlType + `/admin/couponRedemption/code/list`,
    method: "GET",
    params: {
      ...params,
    },
  });
}
export function codeExport(params) {
  return http.download({
    url: urlType + `/admin/couponRedemption/code/export`,
    method: "GET",
    params: {
      ...params,
    },
  });
}
