import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BaseSharePriceVO, BaseSharePriceForm, BaseSharePriceQuery } from '@/api/ems/base/types';

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

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

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

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

/**
 * 删除分时电价维护
 */
export function delBaseSharePrice(objId: string | number | Array<string | number>): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseSharePrice/' + objId,
    method: 'delete'
  });
}
