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

enum Api {
  engineerDialysisDeviceQueryPage = '/device/dialysisDevice/query/page',
  engineerDialysisDeviceDetail = '/device/dialysisDevice/detail',
  engineerDialysisDeviceAdd = '/device/dialysisDevice/add',
  engineerDialysisDeviceEdit = '/device/dialysisDevice/edit',
  engineerDialysisDeviceRemove = '/device/dialysisDevice/removeByIds',
}

/**
 *
 * @author fan
 * @date  2023/06/30 17:39
 * @description: 根据条件查询病床列表,权限 - device:dialysisDevice:query
 * @method: POST
 */

export const engineerDialysisDeviceQueryPage = (params?: object) => {
  return defHttp.post({ url: Api.engineerDialysisDeviceQueryPage, params: setParams(params) });
};
/**
 *
 * @author fan
 * @date  2023/06/30 17:39
 * @description: 根据id查询病床详细信息,权限 - device:dialysisDevice:query
 * @method: GET
 * @param:  id 病床主键id
 */
export const engineerDialysisDeviceDetail = (id: string) => {
  return defHttp.get({ url: Api.engineerDialysisDeviceDetail + '/' + id });
};

/**
 *
 * @author fan
 * @date  2023/06/30 17:39
 * @description: 添加病床,权限 - device:dialysisDevice:add
 * @method: POST
 * @return:
 *       0 添加失败
 *       1 添加成功
 */
export const engineerDialysisDeviceAdd = (params?: object) => {
  return defHttp.post({ url: Api.engineerDialysisDeviceAdd, params: params });
};

/**
 *
 * @author fan
 * @date  2023/06/30 17:39
 * @description: 通过主键id编辑病床,权限 - device:dialysisDevice:edit
 * @method: POST
 * @return:
 *       0 编辑失败
 *       1 编辑成功
 */
export const engineerDialysisDeviceEdit = (params?: object) => {
  return defHttp.post({ url: Api.engineerDialysisDeviceEdit, params: params });
};

/**
 * @description: 删除,权限 - device:dialysisDevice:remove
 * @method: POST
 */
export const engineerDialysisDeviceRemove = (params: Array<string | number>) => {
  return defHttp.post({ url: Api.engineerDialysisDeviceRemove, params: params });
};
