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

// 查询计量设备信息列表
export function listBaseMonitorInfo(query?: EmsQuery): Promise<EmsListResponse<BaseMonitorInfoVO>> {
  return request({
    url: '/ems/base/baseMonitorInfo/list',
    method: 'get',
    params: query
  });
}

// 查询计量设备信息详细
export function getBaseMonitorInfo(objId: EmsId): Promise<EmsDetailResponse<BaseMonitorInfoVO>> {
  return request({
    url: '/ems/base/baseMonitorInfo/' + objId,
    method: 'get'
  });
}

// 新增计量设备信息
export function addBaseMonitorInfo(data: BaseMonitorInfoVO): Promise<EmsActionResponse<BaseMonitorInfoVO>> {
  return request({
    url: '/ems/base/baseMonitorInfo',
    method: 'post',
    data: data
  });
}

// 修改计量设备信息
export function updateBaseMonitorInfo(data: BaseMonitorInfoVO): Promise<EmsActionResponse<BaseMonitorInfoVO>> {
  return request({
    url: '/ems/base/baseMonitorInfo',
    method: 'put',
    data: data
  });
}

// 删除计量设备信息
export function delBaseMonitorInfo(objId: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/base/baseMonitorInfo/' + objId,
    method: 'delete'
  });
}

// 查询计量设备信息下拉树结构
export function getMonitorInfoTree(data?: BaseMonitorInfoVO): Promise<EmsDetailResponse<EmsTreeNode[]>> {
  return request({
    url: '/ems/base/baseMonitorInfo/monitorInfoTree',
    method: 'post',
    data: data
  });
}
