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

enum Api {
  engineerBedQueryPage = '/device/bed/query/page',
  engineerBedDetail = '/device/bed/detail',
  engineerBedAdd = '/device/bed/add',
  engineerBedEdit = '/device/bed/edit',
  engineerBedRemove = '/device/bed/removeByIds',
}

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

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

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

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

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