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

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

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

// 新增电实时数据
export function addRecordDnbInstant(data: EmsRecordDnbInstantVO): Promise<EmsActionResponse<EmsRecordDnbInstantVO>> {
  return request({
    url: '/ems/record/recordDnbInstant',
    method: 'post',
    data: data
  });
}

// 修改电实时数据
export function updateRecordDnbInstant(data: EmsRecordDnbInstantVO): Promise<EmsActionResponse<EmsRecordDnbInstantVO>> {
  return request({
    url: '/ems/record/recordDnbInstant',
    method: 'put',
    data: data
  });
}

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

// 查询电实时数据（曲线）
export function dnbInstantList(query?: EmsQuery): Promise<EmsListResponse<EmsRecordDnbInstantVO>> {
  return request({
    url: '/ems/record/recordDnbInstant/dnbInstantList',
    method: 'get',
    params: query
  });
}
