import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { ElevatorAccessoryVO, ElevatorAccessoryForm, ElevatorAccessoryQuery } from './model';

/**
 * 查询电梯配件信息;列表
 * @param params
 * @returns
 */
export function elevatorAccessoryList(params?: ElevatorAccessoryQuery) {
  return defHttp.get<ElevatorAccessoryVO[]>({ url: '/accessory/elevatorAccessory/list', params });
}

/**
 * 导出电梯配件信息;列表
 * @param params
 * @returns
 */
export function elevatorAccessoryExport(params?: ElevatorAccessoryQuery) {
  return commonExport('/accessory/elevatorAccessory/export', params ?? {});
}

/**
 * 查询电梯配件信息;详细
 * @param id id
 * @returns
 */
export function elevatorAccessoryInfo(id: ID) {
  return defHttp.get<ElevatorAccessoryVO>({ url: '/accessory/elevatorAccessory/' + id });
}

/**
 * 新增电梯配件信息;
 * @param data
 * @returns
 */
export function elevatorAccessoryAdd(data: ElevatorAccessoryForm) {
  return defHttp.postWithMsg<void>({ url: '/accessory/elevatorAccessory', data });
}

/**
 * 更新电梯配件信息;
 * @param data
 * @returns
 */
export function elevatorAccessoryUpdate(data: ElevatorAccessoryForm) {
  return defHttp.putWithMsg<void>({ url: '/accessory/elevatorAccessory', data });
}

/**
 * 删除电梯配件信息;
 * @param id id
 * @returns
 */
export function elevatorAccessoryRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/accessory/elevatorAccessory/' + id });
}
