import { $postParam, $post } from "@/plugins/axios";

export const examStructureClassListPage = (datas) => {
  // examId,paperNumber
  return $postParam("/api/admin/exam/structure/list_user_class", datas);
};

// score-archive
export const scoreListPage = (datas) => {
  return $postParam("/api/admin/sync/score/list", datas);
};
export const scoreExport = (datas) => {
  return $postParam("/api/admin/sync/score/export", datas);
};
export const scoreSync = (datas) => {
  return $postParam("/api/admin/sync/score/sync", datas);
};
export const scorePreview = (id) => {
  return $postParam("/api/admin/sync/score/preview", { id });
};
export const scoreDownload = (id) => {
  return $postParam(
    "/api/admin/sync/score/download",
    { id },
    {
      responseType: "blob",
    }
  );
};
export const scoreBatchDownload = (datas) => {
  return $postParam("/api/admin/sync/score/batch_download", datas);
};
// score-sync
export const scoreLogListPage = (datas) => {
  return $postParam("/api/admin/sync/log/list", datas);
};
export const scoreLogSync = (datas) => {
  return $postParam("/api/admin/sync/log/sync", datas);
};
// 第三方登录ypt
export const userSysRoles = () => {
  return $post("/api/admin/common/get_open_role", {});
};
export const yptAuth = (roleType) => {
  if (roleType === "MARKER") {
    return $post("/api/admin/exam/sso/marker_login", {});
  } else {
    return $post("/api/admin/exam/sso/marker_leader_login", {});
  }
};
// sync-result-manage
export const syncResultListPage = (datas) => {
  return $postParam("/api/admin/data/sync/query", datas);
};
export const syncResync = (id) => {
  return $postParam("/api/admin/data/sync/resync", { id });
};
// question-library-manage
export const tikuAuth = (datas) => {
  return $postParam("/api/admin/exam/sso/question_library_login", datas);
};
