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



const aquestionPageUrl = '/library/exam/question/_page'; // 测试题库查询


/** 测试题库查询 */
export async function aquestionPageConnect(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
    login?: String;

  },
  options?: { [key: string]: any },
) {
  return request<API.IOT.Device>(aquestionPageUrl, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: {
      "pageable": {
        "page": params.current,
        "size": params.pageSize,
      }
    },
    ...(options || {}),
  }).then((res: any) => {
    let result = {
      data: res.content,
      total: res.totalElements,
      success: true,
    };

    if (res.content.length === 0) {
      message.warning('未查询到数据');
    } else {
      message.success('查询完成');
    }

    console.log(result);
    return result;
  });
}


