import { request } from '@/service/request';

/**
 * 分页获取意见反馈列表
 * @param params 查询参数
 */
export function fetchOpinionList(params: any) {
  return request({
    url: '/smqjh-system/api/v1/opinionFeedback/page',
    method: 'get',
    params
  });
}

/**
 * 获取意见反馈类型列表
 * @param params 查询参数
 */
export function fetchOpinionType(params: any) {
  return request({
    url: '/smqjh-system/api/v1/opinionFeedback/opinionTypeList',
    method: 'get',
    params
  });
}

/**
 * 回复意见反馈
 * @param data { id, replyContent }
 */
export function fetchReplyOpinion(data: { id: string; replyContent: string }) {
  return request({
    url: '/smqjh-system/api/v1/opinionFeedback/reply',
    method: 'post',
    data
  });
}

/**
 * 删除意见反馈
 * @param id 反馈ID
 */
export function fetchDeleteOpinion(id: string) {
  return request({
    url: `/smqjh-system/api/v1/opinionFeedback/${id}`,
    method: 'delete'
  });
}
