import http from "@/api";

/**
 * @name 评论申诉管理模块
 */

// 获取评论列表
export const getReviewList = (params: { type?: string; page?: number; pageSize?: number }) => {
  return http.post(`/api/review/list`, params);
};

// 获取申诉历史列表
export const getAppealHistory = (params: { type?: string; page?: number; pageSize?: number }) => {
  return http.post(`/api/review/appealHistory`, params);
};

// 获取申诉详情
export const getAppealDetail = (params: { id: string | number }) => {
  return http.get(`/api/review/appealDetail`, { params });
};

// 提交评论申诉
export const submitReviewAppeal = (params: { reviewId: string | number; reason: string; images?: string[] }) => {
  return http.post(`/api/review/submitAppeal`, params);
};

// 撤销申诉
export const cancelAppeal = (params: { appealId: string | number }) => {
  return http.post(`/api/review/cancelAppeal`, params);
};

// 获取评论统计数据
export const getReviewStatistics = () => {
  return http.get(`/api/review/statistics`);
};
