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

/** 接口列表 */
export async function getInterfaces(
  params: API.SearchAlarmRulesParams | any,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.PageResult; msg?: string }>(
    `/api/device/`,
    {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
      },
      params: {
        ...params,
      },
      ...(options || {}),
    },
  );
}

/** 更新接口列表 */
export async function postInterfaces(
    body: API.UpdateInterfacesParams,
    options?: { [key: string]: any },
  ) {
    return request<API.Response & { data?: API.PageResult; msg?: string }>(
      `/api/device/`,
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
      },
    );
}
