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

// 查询水实时数据列表
export function listRecordWaterInstant(query?: EmsQuery): Promise<EmsListResponse<EmsRecordWaterInstantVO>> {
  return request({
    url: '/ems/record/recordWaterInstant/list',
    method: 'get',
    params: query
  });
}

// 查询水实时数据详细
export function getRecordWaterInstant(objId: EmsId): Promise<EmsDetailResponse<EmsRecordWaterInstantVO>> {
  return request({
    url: '/ems/record/recordWaterInstant/' + objId,
    method: 'get'
  });
}

// 新增水实时数据
export function addRecordWaterInstant(data: EmsRecordWaterInstantVO): Promise<EmsActionResponse<EmsRecordWaterInstantVO>> {
  return request({
    url: '/ems/record/recordWaterInstant',
    method: 'post',
    data: data
  });
}

// 修改水实时数据
export function updateRecordWaterInstant(data: EmsRecordWaterInstantVO): Promise<EmsActionResponse<EmsRecordWaterInstantVO>> {
  return request({
    url: '/ems/record/recordWaterInstant',
    method: 'put',
    data: data
  });
}

// 删除水实时数据
export function delRecordWaterInstant(objId: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/record/recordWaterInstant/' + objId,
    method: 'delete'
  });
}
