import request from '/@/utils/request'

/**
 * 毕业学生名单 - 分页查询
 * 接口文档：GET /api/stuwork/stugraducheck/page
 * 参数：current, size, graduYear, status, type, stuNo, realName, classCode, deptCode 等
 * 返回归一为 data.records / data.total 供 useTable 使用
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/stugraducheck/page',
    method: 'get',
    params: query
  }).then((res: any) => {
    const raw = res.data || {}
    const dataList = raw.dataList || {}
    return {
      ...res,
      data: {
        records: dataList.records || [],
        total: dataList.total ?? 0
      }
    }
  })
}
