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

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

// 查询行李系统PLC缓冲电池生命周期详细
export function getPlcBufferBatteryLifecycle(objid: EmsId): Promise<EmsDetailResponse<LuggageSystemPlcBufferBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/plcBufferBatteryLifecycle/' + objid,
    method: 'get'
  });
}

// 新增行李系统PLC缓冲电池生命周期
export function addPlcBufferBatteryLifecycle(
  data: LuggageSystemPlcBufferBatteryLifecycleVO
): Promise<EmsActionResponse<LuggageSystemPlcBufferBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/plcBufferBatteryLifecycle',
    method: 'post',
    data: data
  });
}

// 修改行李系统PLC缓冲电池生命周期
export function updatePlcBufferBatteryLifecycle(
  data: LuggageSystemPlcBufferBatteryLifecycleVO
): Promise<EmsActionResponse<LuggageSystemPlcBufferBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/plcBufferBatteryLifecycle',
    method: 'put',
    data: data
  });
}

// 删除行李系统PLC缓冲电池生命周期
export function delPlcBufferBatteryLifecycle(objid: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/info/plcBufferBatteryLifecycle/' + objid,
    method: 'delete'
  });
}
