import request from "@/utils/request";

// 查询营销活动列表
export function listActivity(query) {
  return request({
    url: "/brewery/activity/list",
    method: "get",
    params: query,
  });
}

// 查询营销活动详细
export function getActivity(id) {
  return request({
    url: "/brewery/activity/" + id,
    method: "get",
  });
}

// 新增营销活动
export function addActivity(data) {
  return request({
    url: "/brewery/activity",
    method: "post",
    data: data,
  });
}

// 修改营销活动
export function updateActivity(data) {
  return request({
    url: "/brewery/activity",
    method: "put",
    data: data,
  });
}

// 删除营销活动
export function delActivity(id) {
  return request({
    url: "/brewery/activity/" + id,
    method: "delete",
  });
}

// 品牌方活动数据统计
export function activityData() {
  return request({
    url: "/brewery/activity/statistics",
    method: "get",
  });
}

// 酒厂啤酒币数据统计
export function beerCoinData() {
  return request({
    url: "/brewery/beerCoin/statistics",
    method: "get",
  });
}
// 查询持有啤酒币的门店

export function beerCoinBars(data) {
  return request({
    url: "/brewery/beerCoin/bars",
    method: "get",
    params: data,
  });
}

// 中止活动
export function stopActivity(id) {
  return request({
    url: "/brewery/activity/suspend?activityId=" + id,
    method: "post",
  });
}

// 延长活动时间
export function extendActivity(data) {
  return request({
    url: "/brewery/activity/extendTime",
    method: "post",
    data: data,
  });
}

//
export function getActivityConsumeList(data) {
  return request({
    url: "/brewery/qrcodeScanLog/activityConsumeList",
    method: "get",
    params: data,
  });
}

//撤销核销记录
export function cancelConsume(id) {
  return request({
    url: "/brewery/qrcodeScanLog/cancelConsume?logId=" + id,
    method: "post",
  });
}
// 某个活动数据统计
export function getActivityStatistics(id) {
  return request({
    url: "/brewery/qrcodeScanLog/statistics?activityId=" + id,
    method: "get",
  });
}

//查询某个活动参与情况
export function getActivityBatchList(data) {
  return request({
    url: "/brewery/qrcodeScanLog/activityBatchList",
    method: "get",
    params: data,
  });
}
