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

// 查询行李系统安全门铅酸电池生命周期列表
export function listSecurityDoorBatteryLifecycle(query?: EmsQuery): Promise<EmsListResponse<LuggageSystemSecurityDoorBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/securityDoorBatteryLifecycle/list',
    method: 'get',
    params: query
  });
}

// 查询行李系统安全门铅酸电池生命周期详细
export function getSecurityDoorBatteryLifecycle(objid: EmsId): Promise<EmsDetailResponse<LuggageSystemSecurityDoorBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/securityDoorBatteryLifecycle/' + objid,
    method: 'get'
  });
}

// 新增行李系统安全门铅酸电池生命周期
export function addSecurityDoorBatteryLifecycle(
  data: LuggageSystemSecurityDoorBatteryLifecycleVO
): Promise<EmsActionResponse<LuggageSystemSecurityDoorBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/securityDoorBatteryLifecycle',
    method: 'post',
    data: data
  });
}

// 修改行李系统安全门铅酸电池生命周期
export function updateSecurityDoorBatteryLifecycle(
  data: LuggageSystemSecurityDoorBatteryLifecycleVO
): Promise<EmsActionResponse<LuggageSystemSecurityDoorBatteryLifecycleVO>> {
  return request({
    url: '/ems/info/securityDoorBatteryLifecycle',
    method: 'put',
    data: data
  });
}

// 删除行李系统安全门铅酸电池生命周期
export function delSecurityDoorBatteryLifecycle(objid: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/info/securityDoorBatteryLifecycle/' + objid,
    method: 'delete'
  });
}
