import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseDeviceFilesVO, DmsBaseDeviceFilesForm, DmsBaseDeviceFilesQuery } from '@/api/dms/dmsBaseDeviceFiles/types';

/**
 * 查询设备档案信息列表
 * @param query
 * @returns {*}
 */

export const listDmsBaseDeviceFiles = (query?: DmsBaseDeviceFilesQuery): AxiosPromise<DmsBaseDeviceFilesVO[]> => {
  return request({
    url: '/dms/dmsBaseDeviceFiles/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备档案信息详细
 * @param deviceFilesId
 */
export const getDmsBaseDeviceFiles = (deviceFilesId: string | number): AxiosPromise<DmsBaseDeviceFilesVO> => {
  return request({
    url: '/dms/dmsBaseDeviceFiles/' + deviceFilesId,
    method: 'get'
  });
};

/**
 * 新增设备档案信息
 * @param data
 */
export const addDmsBaseDeviceFiles = (data: DmsBaseDeviceFilesForm) => {
  return request({
    url: '/dms/dmsBaseDeviceFiles',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备档案信息
 * @param data
 */
export const updateDmsBaseDeviceFiles = (data: DmsBaseDeviceFilesForm) => {
  return request({
    url: '/dms/dmsBaseDeviceFiles',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备档案信息
 * @param deviceFilesId
 */
export const delDmsBaseDeviceFiles = (deviceFilesId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBaseDeviceFiles/' + deviceFilesId,
    method: 'delete'
  });
};


/**
 * 下拉框查询设备档案信息列表
 * @param query
 * @returns {*}
 */
export function getDmsBaseDeviceFilesList (query) {
    return request({
        url: '/dms/dmsBaseDeviceFiles/getDmsBaseDeviceFilesList',
        method: 'get',
        params: query
    });
};
