import request from "@/utils/request";

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

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

// 新增酒评
export function addReview(data) {
  return request({
    url: "/brewery/review",
    method: "post",
    data: data,
  });
}

// 修改酒评
export function updateReview(data) {
  return request({
    url: "/brewery/review",
    method: "put",
    data: data,
  });
}

// 删除酒评
export function delReview(id) {
  return request({
    url: "/brewery/review/" + id,
    method: "delete",
  });
}

// 酒评top10
export function topReview10BeersList(query) {
  return request({
    url: "/brewery/review/top10BeersList",
    method: "get",
    params: query,
  });
}

// 置顶
export function setTop(id) {
  return request({
    url: "/brewery/review/setTop",
    method: "post",
    params: { id: id },
  });
}

// 取消置顶
export function cancelTop(id) {
  return request({
    url: "/brewery/review/cancelTop",
    method: "post",
    params: { id: id },
  });
}
