import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DiseaseLabelVO, DiseaseLabelForm, DiseaseLabelQuery } from '@/api/system/diseaseLabel/types';

/**
 * 查询疾病/部位标签列表
 * @param query
 * @returns {*}
 */

export const listDiseaseLabel = (query?: DiseaseLabelQuery): AxiosPromise<DiseaseLabelVO[]> => {
  return request({
    url: '/system/diseaseLabel/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询疾病/部位标签详细
 * @param labelId
 */
export const getDiseaseLabel = (labelId: string | number): AxiosPromise<DiseaseLabelVO> => {
  return request({
    url: '/system/diseaseLabel/' + labelId,
    method: 'get'
  });
};

/**
 * 新增疾病/部位标签
 * @param data
 */
export const addDiseaseLabel = (data: DiseaseLabelForm) => {
  return request({
    url: '/system/diseaseLabel',
    method: 'post',
    data: data
  });
};

/**
 * 修改疾病/部位标签
 * @param data
 */
export const updateDiseaseLabel = (data: DiseaseLabelForm) => {
  return request({
    url: '/system/diseaseLabel',
    method: 'put',
    data: data
  });
};

/**
 * 删除疾病/部位标签
 * @param labelId
 */
export const delDiseaseLabel = (labelId: string | number | Array<string | number>) => {
  return request({
    url: '/system/diseaseLabel/' + labelId,
    method: 'delete'
  });
};
