import { defHttp } from '/@/utils/http/axios';
import { setParams } from '/@/utils/index';

enum Api {
  disinfectRecordPage = '/visit/deviceDisinfectRecord/query/page',
  disinfectRecordRemove = '/visit/deviceDisinfectRecord/removeByIds',
  disinfectMaintenance = '/visit/deviceDisinfectMaintenance/all',
  disinfectMaintenanceDetail = '/visit/deviceDisinfectMaintenance/query',
  disinfectMaintenanceEdit = '/visit/deviceDisinfectMaintenance/edit',
}
// 获取机器消毒列表页
export const getDisinfectRecordPage = (params?: object) => {
  return defHttp.post({
    url: Api.disinfectRecordPage,
    params: setParams(params),
  });
};
// 删除机器消毒记录
export const disinfectRecordRemove = (params: Array<string | number>) => {
  return defHttp.post({ url: Api.disinfectRecordRemove, params: params });
};

// 获取机器消毒维护数据
export const disinfectMaintenance = () => {
  return defHttp.get({
    url: Api.disinfectMaintenance,
  });
};

// 通过Id获取机器消毒维护数据
export const disinfectMaintenanceDetail = (id?: string) => {
  return defHttp.get({ url: Api.disinfectMaintenanceDetail + '/' + id });
};

// 修改机器消毒维护数据
export const disinfectMaintenaceEdit = (params?: object) => {
  return defHttp.post({ url: Api.disinfectMaintenanceEdit, params });
};
