import httpApi from "@/api/indexApi";
/** 反馈类型映射（与商家端一致） */
export const typeMap: Record<number, string> = {
  0: "BUG反馈",
  1: "优化反馈",
  2: "功能反馈"
};

export const getTypeName = (type: number): string => typeMap[type] ?? "其他";

/**
 * 获取反馈详情
 * GET /alienStore/feedback/detail?feedbackId=xxx
 */
export const getFeedbackDetail = (params: { feedbackId: number | string }) => {
  return httpApi.get(`/alienStore/feedback/detail`, params, { loading: false });
};

/**
 * 用户回复
 * POST /alienStore/feedback/userReply
 */

export const userReply = (params: { feedbackId: number | string; content: string }) => {
  return httpApi.post(`/alienStore/feedback/userReply`, {
    ...params,
    feedbackSource: 1,
    fileUrlList: []
  });
};
