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

// 查询能源类型信息列表
export function listBaseEnergyType(query?: EmsQuery): Promise<EmsListResponse<BaseEnergyTypeVO>> {
  return request({
    url: '/ems/base/baseEnergyType/list',
    method: 'get',
    params: query
  });
}

// 查询能源类型信息详细
export function getBaseEnergyType(objId: EmsId): Promise<EmsDetailResponse<BaseEnergyTypeVO>> {
  return request({
    url: '/ems/base/baseEnergyType/' + objId,
    method: 'get'
  });
}

// 新增能源类型信息
export function addBaseEnergyType(data: BaseEnergyTypeVO): Promise<EmsActionResponse<BaseEnergyTypeVO>> {
  return request({
    url: '/ems/base/baseEnergyType',
    method: 'post',
    data: data
  });
}

// 修改能源类型信息
export function updateBaseEnergyType(data: BaseEnergyTypeVO): Promise<EmsActionResponse<BaseEnergyTypeVO>> {
  return request({
    url: '/ems/base/baseEnergyType',
    method: 'put',
    data: data
  });
}

// 删除能源类型信息
export function delBaseEnergyType(objId: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/base/baseEnergyType/' + objId,
    method: 'delete'
  });
}

// 查询能源类型信息列表
export function getBaseEnergyTypeList(query?: EmsQuery): Promise<EmsListResponse<BaseEnergyTypeVO>> {
  return request({
    url: '/ems/base/baseEnergyType/getBaseEnergyTypeList',
    method: 'get',
    params: query
  });
}
