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

// 查询分时电价维护列表
export function listBaseSharePrice(query?: EmsQuery): Promise<EmsListResponse<BaseSharePriceVO>> {
  return request({
    url: '/ems/base/baseSharePrice/list',
    method: 'get',
    params: query
  });
}

// 查询分时电价维护详细
export function getBaseSharePrice(objId: EmsId): Promise<EmsDetailResponse<BaseSharePriceVO>> {
  return request({
    url: '/ems/base/baseSharePrice/' + objId,
    method: 'get'
  });
}

// 新增分时电价维护
export function addBaseSharePrice(data: BaseSharePriceVO): Promise<EmsActionResponse<BaseSharePriceVO>> {
  return request({
    url: '/ems/base/baseSharePrice',
    method: 'post',
    data: data
  });
}

// 修改分时电价维护
export function updateBaseSharePrice(data: BaseSharePriceVO): Promise<EmsActionResponse<BaseSharePriceVO>> {
  return request({
    url: '/ems/base/baseSharePrice',
    method: 'put',
    data: data
  });
}

// 删除分时电价维护
export function delBaseSharePrice(objId: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/base/baseSharePrice/' + objId,
    method: 'delete'
  });
}
