import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TreatmentUserVo, TreatmentUserForm, TreatmentUserQuery } from '@/api/workbench/treatmentUser/types';

/**
 * 查询待诊患者列表
 * @param query
 * @returns {*}
 */

export const listTreatmentUser = (query?: TreatmentUserQuery): AxiosPromise<TreatmentUserVo[]> => {
    return request({
        url: '/workbench/treatmentUser/list',
        method: 'get',
        params: query
    });
};

/**
 * 查询待诊患者详细
 * @param id
 */
export const getTreatmentUser = (id: string | number): AxiosPromise<TreatmentUserVo> => {
    return request({
        url: '/workbench/treatmentUser/' + id,
        method: 'get'
    });
};

/**
 * 新增待诊患者
 * @param data
 */
export const addTreatmentUser = (data: TreatmentUserForm) => {
    return request({
        url: '/workbench/treatmentUser',
        method: 'post',
        data: data
    });
};

/**
 * 修改待诊患者
 * @param data
 */
export const updateTreatmentUser = (data: TreatmentUserForm) => {
    return request({
        url: '/workbench/treatmentUser',
        method: 'put',
        data: data
    });
};

/**
 * 删除待诊患者
 * @param id
 */
export const delTreatmentUser = (id: string | number | Array<string | number>) => {
    return request({
        url: '/workbench/treatmentUser/' + id,
        method: 'delete'
    });
};
