// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

export async function statusList(
  body: MachineConnectivity.MachineParams,
  options?: { [key: string]: any },
) {
  return request<MachineConnectivity.MachineStatusStat>(
    '/machineConnectivityApi/machine/statusList',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

export async function staticMachineStatus(
  body: MachineConnectivity.MachineParams,
  options?: { [key: string]: any },
) {
  return request<MachineConnectivity.StaticMachineStatus>(
    '/machineConnectivityApi/machine/staticMachineStatus',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

export async function staticMachineFeed(
  body: MachineConnectivity.MachineParams,
  options?: { [key: string]: any },
) {
  return request<MachineConnectivity.MachineProgramExecStat[]>(
    '/machineConnectivityApi/machine/staticMachineRun',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

export async function downExcel(
  body: MachineConnectivity.MachineParams,
  options?: { [key: string]: any },
) {
  return request<Blob>('/machineConnectivityApi/machine/downExcel', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    responseType: 'blob',
    data: body,
    ...(options || {}),
  });
}
