import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { RescueInfoVO, RescueInfoForm, RescueInfoQuery } from './model';

/**
 * 查询救援站信息;列表
 * @param params
 * @returns
 */
export function rescueInfoList(params?: RescueInfoQuery) {
  return defHttp.get<RescueInfoVO[]>({ url: '/rescue/rescueInfo/list', params });
}

/**
 * 导出救援站信息;列表
 * @param params
 * @returns
 */
export function rescueInfoExport(params?: RescueInfoQuery) {
  return commonExport('/rescue/rescueInfo/export', params ?? {});
}

/**
 * 查询救援站信息;详细
 * @param id id
 * @returns
 */
export function rescueInfoInfo(id: ID) {
  return defHttp.get<RescueInfoVO>({ url: '/rescue/rescueInfo/' + id });
}

/**
 * 新增救援站信息;
 * @param data
 * @returns
 */
export function rescueInfoAdd(data: RescueInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/rescue/rescueInfo', data });
}

/**
 * 更新救援站信息;
 * @param data
 * @returns
 */
export function rescueInfoUpdate(data: RescueInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/rescue/rescueInfo', data });
}

/**
 * 删除救援站信息;
 * @param id id
 * @returns
 */
export function rescueInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/rescue/rescueInfo/' + id });
}
