import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseSpecialdeviceParamVO, DmsBaseSpecialdeviceParamForm, DmsBaseSpecialdeviceParamQuery } from '@/api/dms/dmsBaseSpecialdeviceParam/types';

/**
 * 查询特种设备参数信息列表
 * @param query
 * @returns {*}
 */

export const listDmsBaseSpecialdeviceParam = (query?: DmsBaseSpecialdeviceParamQuery): AxiosPromise<DmsBaseSpecialdeviceParamVO[]> => {
  return request({
    url: '/dms/dmsBaseSpecialdeviceParam/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询特种设备参数信息详细
 * @param specialdeviceParamId
 */
export const getDmsBaseSpecialdeviceParam = (specialdeviceParamId: string | number): AxiosPromise<DmsBaseSpecialdeviceParamVO> => {
  return request({
    url: '/dms/dmsBaseSpecialdeviceParam/' + specialdeviceParamId,
    method: 'get'
  });
};

/**
 * 新增特种设备参数信息
 * @param data
 */
export const addDmsBaseSpecialdeviceParam = (data: DmsBaseSpecialdeviceParamForm) => {
  return request({
    url: '/dms/dmsBaseSpecialdeviceParam',
    method: 'post',
    data: data
  });
};

/**
 * 修改特种设备参数信息
 * @param data
 */
export const updateDmsBaseSpecialdeviceParam = (data: DmsBaseSpecialdeviceParamForm) => {
  return request({
    url: '/dms/dmsBaseSpecialdeviceParam',
    method: 'put',
    data: data
  });
};

/**
 * 删除特种设备参数信息
 * @param specialdeviceParamId
 */
export const delDmsBaseSpecialdeviceParam = (specialdeviceParamId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBaseSpecialdeviceParam/' + specialdeviceParamId,
    method: 'delete'
  });
};


/**
 * 下拉框查询特种设备参数信息列表
 * @param query
 * @returns {*}
 */
export function getDmsBaseSpecialdeviceParamList (query) {
    return request({
        url: '/dms/dmsBaseSpecialdeviceParam/getDmsBaseSpecialdeviceParamList',
        method: 'get',
        params: query
    });
};
