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

/** 获取服务器信息 POST /system/getServerInfo */
export async function postSystemGetServerInfo(options?: { [key: string]: any }) {
  return request<API.Response & { data?: Record<string, any>; msg?: string }>(
    `/api/v1/system/getServerInfo`,
    {
      method: 'POST',
      ...(options || {}),
    },
  );
}

/** 获取配置文件内容 POST /system/getSystemConfig */
export async function postSystemGetSystemConfig(options?: { [key: string]: any }) {
  return request<API.Response & { data?: API.SysConfigResponse; msg?: string }>(
    `/api/v1/system/getSystemConfig`,
    {
      method: 'POST',
      ...(options || {}),
    },
  );
}

/** 重启系统 POST /system/reloadSystem */
export async function postSystemReloadSystem(options?: { [key: string]: any }) {
  return request<API.Response & { msg?: string }>(`/api/v1/system/reloadSystem`, {
    method: 'POST',
    ...(options || {}),
  });
}

/** 设置配置文件内容 POST /system/setSystemConfig */
export async function postSystemSetSystemConfig(
  body: API.System,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: string }>(`/api/v1/system/setSystemConfig`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
