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/check/image/list",
    method: "post",
    params: data,
  });

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

export const imageCheckFailedExport = (
  data: ImageCheckFailedParams
): Promise<AxiosResponse<Blob>> =>
  request({
    url: "/api/admin/check/image/failed/export",
    method: "get",
    params: data,
    download: true,
  });
