import request from '@/utils/request'

export interface ElevatorVO {
  id: number
  hkOutPoint: string
  hkInPoint: string
  zsOutPoint: string
  zsInPoint: string
  enable: boolean
  workingTask: string
  outboundWorkingTask: string
  outboundWaitingTaskChains?: string[]
  /** 通过负载模式分配的任务链编码列表 */
  taskChains?: string[]
}

export function getElevatorList() {
  return request.get<never, { code: number; data: ElevatorVO[] }>(
    '/api/robot/external/admin/machine-task/elevator/list',
  )
}

export function getElevatorDetail(id: number) {
  return request.get<never, { code: number; data: ElevatorVO }>(
    `/api/robot/external/admin/machine-task/elevator/${id}`,
  )
}

export function enableElevator(id: number) {
  return request.get<never, { code: number; data: boolean }>(
    `/api/robot/external/admin/machine-task/elevator/enable/${id}`,
  )
}

export function disableElevator(id: number) {
  return request.get<never, { code: number; data: boolean }>(
    `/api/robot/external/admin/machine-task/elevator/disable/${id}`,
  )
}

export function clearElevator(id: number) {
  return request.get<never, { code: number; data: boolean }>(
    `/api/robot/external/admin/machine-task/elevator/clear/${id}`,
  )
}
