import { AxiosResponse } from "axios";
import { request } from "@/utils/request";

import {
  ExamParams,
  ExamPageParams,
  RequestActionResult,
} from "./types/common";
import {
  ImageCheckListPageResult,
  ImageCheckFailedListPageResult,
  ImageCheckFailedParams,
} from "./types/imageCheck";

// 图片检查
export const imageCheckList = (
  data: ExamPageParams
): Promise<ImageCheckListPageResult> =>
  request({
    url: "/api/admin/subject/image-check/list",
    method: "post",
    data,
  });

export const imageCheckFailedList = (
  data: ImageCheckFailedParams
): Promise<ImageCheckFailedListPageResult> =>
  request({
    url: "/api/admin/subject/image-check/failed/page",
    method: "post",
    data,
  });

export const imageCheckFailedExport = (
  data: ImageCheckFailedParams
): Promise<AxiosResponse<Blob>> =>
  request({
    url: "/api/admin/subject/image-check/failed/export",
    method: "post",
    data,
    responseType: "blob",
  });
