import request from '@/utils/request';
import type { EmsActionResponse, EmsDetailResponse, BaseCollectDeviceInfoVO, EmsId, EmsIdParam, EmsListResponse, EmsQuery } from '../types';

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

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

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

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

// 删除采集设备信息
export function delBaseCollectDeviceInfo(objId: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/base/baseCollectDeviceInfo/' + objId,
    method: 'delete'
  });
}

// 查询采集设备信息列表
export function getCollectDeviceInfo(query?: EmsQuery): Promise<EmsListResponse<BaseCollectDeviceInfoVO>> {
  return request({
    url: '/ems/base/baseCollectDeviceInfo/getCollectDeviceInfo',
    method: 'get',
    params: query
  });
}
