import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { ElevatorInsuranceVO, ElevatorInsuranceForm, ElevatorInsuranceQuery } from './model';

/**
 * 查询电梯和保险信息列表
 * @param params
 * @returns
 */
export function elevatorInsuranceList(params?: ElevatorInsuranceQuery) {
  return defHttp.get<ElevatorInsuranceVO[]>({ url: '/elevator/elevatorInsurance/list', params });
}

/**
 * 导出电梯和保险信息列表
 * @param params
 * @returns
 */
export function elevatorInsuranceExport(params?: ElevatorInsuranceQuery) {
  return commonExport('/elevator/elevatorInsurance/export', params ?? {});
}

/**
 * 查询电梯和保险信息详细
 * @param id id
 * @returns
 */
export function elevatorInsuranceInfo(id: ID) {
  return defHttp.get<ElevatorInsuranceVO>({ url: '/elevator/elevatorInsurance/' + id });
}

/**
 * 新增电梯和保险信息
 * @param data
 * @returns
 */
export function elevatorInsuranceAdd(data: ElevatorInsuranceForm) {
  return defHttp.postWithMsg<void>({ url: '/elevator/elevatorInsurance', data });
}

/**
 * 更新电梯和保险信息
 * @param data
 * @returns
 */
export function elevatorInsuranceUpdate(data: ElevatorInsuranceForm) {
  return defHttp.putWithMsg<void>({ url: '/elevator/elevatorInsurance', data });
}

/**
 * 删除电梯和保险信息
 * @param id id
 * @returns
 */
export function elevatorInsuranceRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/elevator/elevatorInsurance/' + id });
}
