import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { BlackBoxInfoVO, BlackBoxInfoForm, BlackBoxInfoQuery } from './model';

/**
 * 查询黑匣子信息;列表
 * @param params
 * @returns
 */
export function blackBoxInfoList(params?: BlackBoxInfoQuery) {
  return defHttp.get<BlackBoxInfoVO[]>({ url: '/blackBox/blackBoxInfo/list', params });
}
/**
 * 查询黑匣子设备运行信息
 * @param params
 * @returns
 */
export function blackRunInfoList(params) {
  return defHttp.get({ url: '/elevator/behaviorStatistics/list', params });
}
/**
 * 导出黑匣子信息;列表
 * @param params
 * @returns
 */
export function blackBoxInfoExport(params?: BlackBoxInfoQuery) {
  return commonExport('/blackBox/blackBoxInfo/export', params ?? {});
}

/**
 * 查询黑匣子信息;详细
 * @param id id
 * @returns
 */
export function blackBoxInfoInfo(id: ID) {
  return defHttp.get<BlackBoxInfoVO>({ url: '/blackBox/blackBoxInfo/' + id });
}

/**
 * 新增黑匣子信息;
 * @param data
 * @returns
 */
export function blackBoxInfoAdd(data: BlackBoxInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/blackBox/blackBoxInfo', data });
}

/**
 * 更新黑匣子信息;
 * @param data
 * @returns
 */
export function blackBoxInfoUpdate(data: BlackBoxInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/blackBox/blackBoxInfo', data });
}

/**
 * 删除黑匣子信息;
 * @param id id
 * @returns
 */
export function blackBoxInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/blackBox/blackBoxInfo/' + id });
}
