import { request } from '@/service/request';

export interface QueryStudentScoresParams {
  groupId?: number;
  studentId?: number;
  subjectId?: number;
  categoryId?: number;
  studentName?: string;
  score?: Record<string, unknown>;
}

export interface ScoresPojo {
  id: number;
  groupId: number;
  categoryId: number;
  subjectId: number;
  testDate: Date;
  type: string;
  studentId: number;
  groupName: string;
  studentName: string;
  score: number;
  passRate: number;
  excelRate: number;
  comment: string;
  categoryName: string;
  subjectsName: string;
}

export function queryStudentScores(
  pageNum: number,
  pageSize: number,
  params: QueryStudentScoresParams
): Promise<Service.RequestResult<ScoresPojo[]>> {
  return request.post(`/scores/queryScores?pageNum=${pageNum}&pageSize=${pageSize}`, params);
}
