import request from "@/utils/request";

/** 投诉建议列表 */
export function getComplaintList(params) {
  return request({
    url: "/platform/complaint/list",
    method: "get",
    params,
  });
}

export function getComplaintDetail(id) {
  return request({
    url: `/platform/complaint/${id}`,
    method: "get",
  });
}

export function createComplaint(data) {
  return request({
    url: "/platform/complaint",
    method: "post",
    data,
  });
}

export function updateComplaint(id, data) {
  return request({
    url: `/platform/complaint/${id}`,
    method: "post",
    data,
  });
}

export function deleteComplaint(id) {
  return request({
    url: `/platform/complaint/${id}`,
    method: "delete",
  });
}

/** 产品分类（投诉建议用） */
export function getComplaintCategoryList() {
  return request({
    url: "/platform/complaintCategory/list",
    method: "get",
  });
}

export function getComplaintCategorySelect() {
  return request({
    url: "/platform/complaintCategory/select",
    method: "get",
  });
}

export function createComplaintCategory(data) {
  return request({
    url: "/platform/complaintCategory",
    method: "post",
    data,
  });
}

export function updateComplaintCategory(id, data) {
  return request({
    url: `/platform/complaintCategory/${id}`,
    method: "post",
    data,
  });
}

export function deleteComplaintCategory(id) {
  return request({
    url: `/platform/complaintCategory/${id}`,
    method: "delete",
  });
}
