import request from "@/utils/request";

// 查询啤酒列表
export function listBeer(query) {
  return request({
    url: "/brewery/beer/list",
    method: "get",
    params: query,
  });
}

// 查询啤酒详细
export function getBeer(id) {
  return request({
    url: "/brewery/beer/" + id,
    method: "get",
  });
}

// 新增啤酒
export function addBeer(data) {
  return request({
    url: "/brewery/beer",
    method: "post",
    data: data,
  });
}

// 修改啤酒
export function updateBeer(data) {
  return request({
    url: "/brewery/beer",
    method: "put",
    data: data,
  });
}

// 删除啤酒
export function delBeer(id) {
  return request({
    url: "/brewery/beer/" + id,
    method: "delete",
  });
}

// 修改啤酒币数量
export function updateBeerIcons(data) {
  return request({
    url: "/brewery/beer/icons",
    method: "post",
    data: data,
  });
}
// 修改酒款上架状态
export function updateBeerSaleStatus(data) {
  return request({
    url: "/brewery/beer/onsale",
    method: "put",
    data: data,
  });
}

// 查询所有的啤酒
export function allBeers() {
  return request({
    url: "/brewery/beer/all",
    method: "get",
  });
}

// 修改首评赠送啤酒币数量
export function updateReviewIcons(data) {
  return request({
    url: "/brewery/beer/reviewIcons",
    method: "post",
    data: data,
  });
}

// 查询某酒款有关的营销活动列表
export function activityListByBeerId(data) {
  return request({
    url: "/brewery/beer/activityListByBeerId/" + data.beerId,
    method: "get",
    params: {
      pageNum: data.pageNum,
      pageSize: data.pageSize,
    },
  });
}

// 查询某酒款有关批次列表
export function batchListByBeerId(data) {
  return request({
    url: "/brewery/beer/batchListByBeerId/" + data.beerId,
    method: "get",
    params: {
      pageNum: data.pageNum,
      pageSize: data.pageSize,
    },
  });
}

// 酒款风格列表
export function styleList() {
  return request({
    url: "/brewery/beer/styleList",
    method: "get",
  });
}
