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

// 参数接口
export interface Add_Params {
  id?: number;
  archiveNumber?: string;
  studentNumber?: string;
  studentName?: string;
  gender?: string;
  birthdate?: Record<string, unknown>;
  address?: string;
  phone?: string;
  email?: string;
  enrollmentDate?: Record<string, unknown>;
  graduationDate?: Record<string, unknown>;
  grade?: number;
  major?: string;
  minor?: string;
  university?: string;
  createTime?: Record<string, unknown>;
  modifyTime?: Record<string, unknown>;
  admissionsId?: number;
  managerId?: number;
  createUid?: number;
  studentIdnumber?: string;
}

export interface Add_6Res {
  status: boolean;
  msg: string;
  data: Record<string, unknown>;
  code: number;
}

export function editRequest(params: Add_Params): Promise<Service.RequestResult<Add_6Res>> {
  return request.post(`/student/update`, params);
}

export function pageRequest(
  pageNum: number,
  pageSize: number,
  params: Add_Params
): Promise<Service.RequestResult<Add_6Res>> {
  return request.post(`/student/query?pageNum=${pageNum}&pageSize=${pageSize}`, params);
}

export function delRequest(id: number): Promise<Service.RequestResult<Add_6Res>> {
  return request.post(`/student/del/${id}`);
}

export function addRequest(params: Add_Params): Promise<Service.RequestResult<Add_6Res>> {
  return request.post(`/student/add`, params);
}
