import request from '@/utils/request';
import { AxiosPromise } from 'axios';

export interface MainStudentEducationVO {
  id?: string | number;
  studentId?: string | number;
  school?: string;
  education?: string;
  startTime?: string;
  endTime?: string;
  major?: string;
  campusExperience?: string;
}

export interface MainStudentExperienceVO {
  id?: string | number;
  studentId?: string | number;
  company?: string;
  industry?: string;
  startTime?: string;
  endTime?: string;
  isInternship?: number;
  jobTitle?: string;
  department?: string;
  workContent?: string;
}

export interface MainStudentProjectVO {
  id?: string | number;
  studentId?: string | number;
  projectName?: string;
  role?: string;
  startTime?: string;
  endTime?: string;
  description?: string;
  achievement?: string;
  link?: string;
}

export interface MainExamApplyRecordVO {
  id?: string | number;
  evaluationId?: string | number;
  evaluationName?: string;
  positionName?: string;
  studentId?: string | number;
  applyStatus?: string;
  finalResult?: string;
  statusText?: string;
  statusType?: string;
  scheduleStartTime?: string;
  deadlineTime?: string;
  finishedTime?: string;
  createTime?: string;
}

export interface StudentTrainingRecordVO {
  id?: string | number;
  trainingId?: string | number;
  studentId?: string | number;
  name?: string;
  trainingType?: string;
  trainingStartTime?: string;
  trainingEndTime?: string;
  progress?: number;
  learnStatus?: number;
  enrollStatus?: number;
  checkInTime?: string;
}

export interface StudentJobRecordVO {
  id?: string | number;
  candidateId?: string | number;
  tenantId?: string;
  postId?: string | number;
  studentId?: string | number;
  employmentStatus?: string;
  entryTime?: string;
  leaveTime?: string;
  leaveReason?: string;
  companyName?: string;
  postName?: string;
  postType?: string;
}

export interface MainStudentVO {
  id?: string | number;
  studentNo?: string;
  name?: string;
  mobile?: string;
  email?: string;
  idCardNumber?: string;
  gender?: string;
  avatar?: string | number;
  avatarUrl?: string;
  userType?: string;
  userTypeLabel?: string;
  totalAmount?: number;
  availability?: string;
  jobIntention?: string;
  intentionCompanies?: string;
  jobType?: string;
  schoolName?: string;
  education?: string;
  grade?: string;
  internshipDuration?: string;
  resumeFile?: string | number;
  status?: string;
  loginDate?: string;
  createTime?: string;
  updateTime?: string;
  remark?: string;
  educationList?: MainStudentEducationVO[];
  experienceList?: MainStudentExperienceVO[];
  projectList?: MainStudentProjectVO[];
  evaluationList?: MainExamApplyRecordVO[];
  trainingList?: StudentTrainingRecordVO[];
  jobList?: StudentJobRecordVO[];
}

export function getStudentInfo(id: string | number): AxiosPromise<MainStudentVO> {
  return request({
    url: `/main/student/${id}`,
    method: 'get'
  });
}
