import request from "@/utils/request";
import type { smartWarningQuery } from "./type";

//校园概览页面相关的请求地址
enum API {
  // 办学规模信息接口地址
  SCALE_URL = "/wanzai/api/driver/getClassTj",
  // 近一年访客管理信息接口地址
  VISITOR_URL = "/wanzai/api/driver/getVisitorTj",
  // 预警推送信息接口地址
  WARNING_URL = "/wanzai/api/driver/queryPageSmartWarning",
  // 机动车通行记录接口
  CARRECORD_URL = "/wanzai/api/smartCarAccess/getPage",
  // 人员通行记录接口
  PEOPLERECORD_URL = "/wanzai/api/smartAccess/getAccessPage",

  // 门禁通行数量总数
  TOTALCOUNT_URL = "/wanzai/api/smartAccess/totalCount",

  // 获取年级列表数据
  GRADELIST_URL = "/wanzai/api/smartGrade/querySmartGrades",

  // 获取班级列表数据
  CLASSLIST_URL = "/wanzai/api/smartClass/querySmartClasss",
}

// 办学规模信息接口
export const reqGetSchoolScale = () => request.get(API.SCALE_URL);

// 近一年访客管理信息接口
export const reqGetSchoolVisitor = () => request.get(API.VISITOR_URL);

// 预警推送信息接口
export const reqGetSmartWarning = (data: smartWarningQuery) =>
  request.get(
    `${API.WARNING_URL}?currentPage=${data.currentPage}&pageCount=${data.pageCount}`
  );

// 机动车通行记录
export const reqGetCarRecord = (params: any) =>
  request.get(API.CARRECORD_URL, { params });

// 人员通行记录
export const reqGetPeopleRecord = (params: any) =>
  request.get(API.PEOPLERECORD_URL, { params });

// 门禁通行数量总数
export const reqGetTotalCount = () => request.get(API.TOTALCOUNT_URL);

// 获取年级列表数据
export const reqGetGradeList = () => request.get(API.GRADELIST_URL);

// 获取班级列表数据
export const reqGetClassList = (params: any) =>
  request.get(API.CLASSLIST_URL, { params });
