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

// 查询行李系统UPS电池生命周期列表
export function listUpsBatteryLifecycle(query?: EmsQuery): Promise<EmsListResponse<UpsBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/upsBatteryLifecycle/list',
    method: 'get',
    params: query
  });
}

// 查询行李系统UPS电池生命周期详细
export function getUpsBatteryLifecycle(id: EmsId): Promise<EmsDetailResponse<UpsBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/upsBatteryLifecycle/' + id,
    method: 'get'
  });
}

// 新增行李系统UPS电池生命周期
export function addUpsBatteryLifecycle(data: UpsBatteryLifecycleVO): Promise<EmsActionResponse<UpsBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/upsBatteryLifecycle',
    method: 'post',
    data: data
  });
}

// 修改行李系统UPS电池生命周期
export function updateUpsBatteryLifecycle(data: UpsBatteryLifecycleVO): Promise<EmsActionResponse<UpsBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/upsBatteryLifecycle',
    method: 'put',
    data: data
  });
}

// 删除行李系统UPS电池生命周期
export function delUpsBatteryLifecycle(id: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/info/upsBatteryLifecycle/' + id,
    method: 'delete'
  });
}
