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

enum Api {
  bedScheduledPersonQueryPage = '/bed/scheduledPerson/query/page',
  bedScheduledPersonDetail = '/bed/scheduledPerson/detail',
  bedScheduledPersonAdd = '/bed/scheduledPerson/add',
  bedScheduledPersonEdit = '/bed/scheduledPerson/edit',
  bedScheduledPersonRemove = '/bed/scheduledPerson/removeByIds',
  bedScheduledPersonStats = '/bed/scheduledPerson/stats',
}

/**
 * @author fan
 * @description 病人类型数量统计
 * @returns
 */
export const bedScheduledPersonStats = () => {
  return defHttp.post({ url: Api.bedScheduledPersonStats });
};

/**
 *
 * @author fan
 * @date  2023/07/17 16:06
 * @description: 根据条件查询排列表,权限 - scheduled:scheduledPerson:query
 * @method: POST
 */

export const bedScheduledPersonQueryPage = (params?: object) => {
  return defHttp.post({ url: Api.bedScheduledPersonQueryPage, params: setParams(params) });
};
/**
 *
 * @author fan
 * @date  2023/07/17 16:06
 * @description: 根据id查询排详细信息,权限 - scheduled:scheduledPerson:query
 * @method: GET
 * @param:  id 主键id
 */
export const bedScheduledPersonDetail = (id: string) => {
  return defHttp.get({ url: Api.bedScheduledPersonDetail + '/' + id });
};

/**
 *
 * @author fan
 * @date  2023/07/17 16:06
 * @description: 添加排,权限 - scheduled:scheduledPerson:add
 * @method: POST
 */
export const bedScheduledPersonAdd = (params?: object) => {
  return defHttp.post({ url: Api.bedScheduledPersonAdd, params: params });
};

/**
 *
 * @author fan
 * @date  2023/07/17 16:06
 * @description: 通过主键id编辑排,权限 - scheduled:scheduledPerson:edit
 * @method: POST
 */
export const bedScheduledPersonEdit = (params?: object) => {
  return defHttp.post({ url: Api.bedScheduledPersonEdit, params: params });
};

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