import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseTransferInfoVO, DmsBaseTransferInfoForm, DmsBaseTransferInfoQuery } from '@/api/dms/dmsBaseTransferInfo/types';

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

export const listDmsBaseTransferInfo = (query?: DmsBaseTransferInfoQuery): AxiosPromise<DmsBaseTransferInfoVO[]> => {
  return request({
    url: '/dms/dmsBaseTransferInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备转移信息详细
 * @param transferInfoId
 */
export const getDmsBaseTransferInfo = (transferInfoId: string | number): AxiosPromise<DmsBaseTransferInfoVO> => {
  return request({
    url: '/dms/dmsBaseTransferInfo/' + transferInfoId,
    method: 'get'
  });
};

/**
 * 新增设备转移信息
 * @param data
 */
export const addDmsBaseTransferInfo = (data: DmsBaseTransferInfoForm) => {
  return request({
    url: '/dms/dmsBaseTransferInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备转移信息
 * @param data
 */
export const updateDmsBaseTransferInfo = (data: DmsBaseTransferInfoForm) => {
  return request({
    url: '/dms/dmsBaseTransferInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备转移信息
 * @param transferInfoId
 */
export const delDmsBaseTransferInfo = (transferInfoId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBaseTransferInfo/' + transferInfoId,
    method: 'delete'
  });
};


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