import { http } from "@/utils/http";

/** 优惠活动列表 */
export const getPromotionList = (data?: object) => {
  return http.request<any>("get", "/rechargePromotion/list", { params: data });
};

/** 新增活动 */
export const addPromotion = (data: object) => {
  return http.request<any>("post", "/rechargePromotion/add", { data });
};

/** 修改活动 */
export const modifyPromotion = (data: object) => {
  return http.request<any>("post", "/rechargePromotion/modify", { data });
};

/** 删除活动 */
export const removePromotion = (id: number) => {
  return http.request<any>("get", `/rechargePromotion/remove/${id}`);
};

/** 生成活动二维码 */
export const generatePromotionQR = (id: number) => {
  return http.request<any>("get", `/rechargePromotion/generateQR/${id}`);
};
