import { get } from '../../http'

// 参数类型定义
interface ClassQueryParams {
  flag?: string
  page?: number
  size?: number
}

interface StudentListParams {
  classFlag: string
  page?: number
  size?: number
}

interface GroupQueryParams {
  classId: string
  page?: number
  size?: number
}

interface StudentReportParams {
  endDate?: string
  id: string
  startDate?: string
}

// 获取班级列表
const getClassByFlag = async (params?: ClassQueryParams) => {
  return await get<any>('/sysUser/queryClassByFlag', params)
}

// 根据班级获取学生
const getStudentList = async (params: StudentListParams) => {
  return await get<any>('/sysUser/queryStuDetailByClzFlag', params)
}

// 根据班级获取小组
const getGroupByClass = async (params: GroupQueryParams) => {
  return await get<any>('/sysUser/queryGroupByClass', params)
}

// 获取学生学情报告
const getStudentReport = async (params: StudentReportParams) => {
  return await get<any>(`/sysUser/queryStuReportByUserId/${params.id}`, params)
}

const dailyReportApi = {
  getClassByFlag,
  getStudentList,
  getGroupByClass,
  getStudentReport,
}

export default dailyReportApi
