import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { PassengerFeedbackVO, PassengerFeedbackForm, PassengerFeedbackQuery } from './model';

/**
 * 查询乘客反馈信息;列表
 * @param params
 * @returns
 */
export function passengerFeedbackList(params?: PassengerFeedbackQuery) {
  return defHttp.get<PassengerFeedbackVO[]>({ url: '/feedback/passengerFeedback/list', params });
}

/**
 * 导出乘客反馈信息;列表
 * @param params
 * @returns
 */
export function passengerFeedbackExport(params?: PassengerFeedbackQuery) {
  return commonExport('/feedback/passengerFeedback/export', params ?? {});
}

/**
 * 查询乘客反馈信息;详细
 * @param id id
 * @returns
 */
export function passengerFeedbackInfo(id: ID) {
  return defHttp.get<PassengerFeedbackVO>({ url: '/feedback/passengerFeedback/' + id });
}

/**
 * 新增乘客反馈信息;
 * @param data
 * @returns
 */
export function passengerFeedbackAdd(data: PassengerFeedbackForm) {
  return defHttp.postWithMsg<void>({ url: '/feedback/passengerFeedback', data });
}

/**
 * 更新乘客反馈信息;
 * @param data
 * @returns
 */
export function passengerFeedbackUpdate(data: PassengerFeedbackForm) {
  return defHttp.putWithMsg<void>({ url: '/feedback/passengerFeedback', data });
}

/**
 * 删除乘客反馈信息;
 * @param id id
 * @returns
 */
export function passengerFeedbackRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/feedback/passengerFeedback/' + id });
}
