import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BaseCollectDeviceInfoVO, BaseCollectDeviceInfoForm, BaseCollectDeviceInfoQuery } from '@/api/ems/base/types';

/**
 * 查询采集设备信息列表
 */
export function listBaseCollectDeviceInfo(query: BaseCollectDeviceInfoQuery): AxiosPromise<BaseCollectDeviceInfoVO[]> {
  return request({
    url: '/ems/base/baseCollectDeviceInfo/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询采集设备信息详细
 */
export function getBaseCollectDeviceInfo(objId: string | number): AxiosPromise<BaseCollectDeviceInfoVO> {
  return request({
    url: '/ems/base/baseCollectDeviceInfo/' + objId,
    method: 'get'
  });
}

/**
 * 新增采集设备信息
 */
export function addBaseCollectDeviceInfo(data: BaseCollectDeviceInfoForm): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseCollectDeviceInfo',
    method: 'post',
    data: data
  });
}

/**
 * 修改采集设备信息
 */
export function updateBaseCollectDeviceInfo(data: BaseCollectDeviceInfoForm): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseCollectDeviceInfo',
    method: 'put',
    data: data
  });
}

/**
 * 删除采集设备信息
 */
export function delBaseCollectDeviceInfo(objId: string | number | Array<string | number>): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseCollectDeviceInfo/' + objId,
    method: 'delete'
  });
}

/**
 * 查询采集设备信息列表(不分页)
 */
export function getCollectDeviceInfo(query?: BaseCollectDeviceInfoQuery): AxiosPromise<BaseCollectDeviceInfoVO[]> {
  return request({
    url: '/ems/base/baseCollectDeviceInfo/getCollectDeviceInfo',
    method: 'get',
    params: query
  });
}
