import request from "@/utils/request"

// 保存基本信息
export const saveResumeBasicInfo = async (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/info/save',
    method: 'POST',
    data,
    custom: {
      openEncryption: true,
      showLoading: false,
      auth: true
    }
  })
}

// // 保存个人优势
// export const saveResumeAdvantage = async (data) => {
//   return await request.post({
//     url: '/app-api/menduner/system/person/resume/advantage/save',
//     data
//   })
// }

// 保存培训经历
export const saveResumeTrainExp = async (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/train/exp/save',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 删除培训经历
export const deleteResumeTrainExp = async (id) => {
  return request({
    url: '/app-api/menduner/system/person/resume/train/exp/remove?id=' + id,
    method: 'DELETE',
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 获取培训经历
export const getResumeTrainExp = async () => {
  return request({
    url: '/app-api/menduner/system/person/resume/get/train/exp',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// // 获取-教育经历
export const getResumeEduExp = async () => {
  return request({
    url: '/app-api/menduner/system/person/resume/get/edu/exp',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 删除-教育经历
export const deleteResumeEduExp = async (id) => {
  return request({
    url: '/app-api/menduner/system/person/resume/edu/exp/remove?id=' + id,
    method: 'DELETE',
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 保存-教育经历
export const saveResumeEduExp = async (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/edu/exp/save',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取-工作经历
export const getResumeWorkExp = async () => {
  return request({
    url: '/app-api/menduner/system/person/resume/get/work/exp',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 删除-工作经历
export const deleteResumeWorkExp = async (id) => {
  return request({
    url: '/app-api/menduner/system/person/resume/work/exp/remove?id=' + id,
    method: 'DELETE',
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 保存-工作经历
export const saveResumeWorkExp = async (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/work/exp/save',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// // 保存项目经历
// export const saveResumeProjectExp = async (data) => {
//   return await request.post({
//     url: '/app-api/menduner/system/person/resume/project/exp/save',
//     data
//   })
// }

// // 删除项目经历
// export const deleteResumeProjectExp = async (id) => {
//   return await request.delete({
//     url: '/app-api/menduner/system/person/resume/project/exp/remove?id=' + id
//   })
// }

// 获取项目经历
// export const getResumeProjectExp = async () => {
//   return request({
//     url: '/app-api/menduner/system/person/resume/get/project/exp',
//     method: 'GET',
//     custom: {
//       showLoading: false,
//       auth: true
//     }
//   })
// }

// 获取-技能树形
export const getSkillTree = async () => {
  return request({
    url: '/app-api/menduner/system/skill/get/tree',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取-职业技能
export const getResumePersonSkill = async () => {
  return request({
    url: '/app-api/menduner/system/person/resume/get/person/skill',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 删除-职业技能
export const deleteResumePersonSkill = async (id) => {
  return request({
    url: '/app-api/menduner/system/person/resume/person/skill/remove?id=' + id,
    method: 'DELETE',
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 保存-职业技能
export const saveResumePersonSkill = async (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/person/skill/save',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 保存求职意向
export const saveResumeJobInterested = async (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/job/interested/save',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 删除求职意向
export const deleteResumeJobInterested = async (id) => {
  return request({
    url: '/app-api/menduner/system/person/resume/job/interested/remove?id=' + id,
    method: 'DELETE',
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// // 获取求职意向
export const getResumeJobInterested = async () => {
  return request({
    url: '/app-api/menduner/system/person/resume/get/job/interested',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// // 根据专业名称模糊搜索
export const schoolMajorByName = async (params) => {
  return request({
    url: '/app-api/menduner/system/major/search/by/name',
    params,
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 根据学校名称模糊搜索
export const schoolSearchByName = async (params) => {
  return request({
    url: '/app-api/menduner/system/school/search/by/name',
    params,
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 根据企业名称模糊搜索
export const enterpriseSearchByName = async (params) => {
  return request({
    url: '/app-api/menduner/system/enterprise/search/by/name',
    params,
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// // 保存附件
// export const savePersonResumeCv = async (data) => {
//   return await request.post({
//     url: '/app-api/menduner/system/person/resume/person/cv/save',
//     data
//   })
// }

// // 删除附件
// export const deletePersonResumeCv = async (id) => {
//   return await request.delete({
//     url: '/app-api/menduner/system/person/resume/person/cv/remove?id=' + id
//   })
// }

// // 获取附件列表
// export const getPersonResumeCv = async () => {
//   return await request.get({
//     url: '/app-api/menduner/system/person/resume/get/person/cv'
//   })
// }

// // 修改求职类型
// export const updateJobStatus = async (data) => {
//   return await request.post({
//     url: '/app-api/menduner/system/person/resume/job/status/update?status=' + data,
//   })
// }

// // 修改人才头像
// export const updatePersonAvatar = async (url) => {
//   return await request.post({
//     url: `/app-api/menduner/system/person/resume/avatar/update?avatar=${url}`
//   })
// }

// // 修改个人画像
// export const savePersonPortrait = async (data) => {
//   return await request.post({
//     url: '/app-api/menduner/system/person/resume/tag/update',
//     data
//   })
// }