import request from '@/config/axios'

// 保存基本信息
export const saveResumeBasicInfo = async (data) => {
  return await request.post({
    url: '/app-api/menduner/system/person/resume/info/save',
    data
  })
}

// 保存个人优势
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 await request.post({
    url: '/app-api/menduner/system/person/resume/train/exp/save',
    data
  })
}

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

// 获取培训经历
export const getResumeTrainExp = async () => {
  return await request.get({
    url: '/app-api/menduner/system/person/resume/get/train/exp'
  })
}

// 获取-教育经历
export const getResumeEduExp = async () => {
  return await request.get({
    url: '/app-api/menduner/system/person/resume/get/edu/exp'
  })
}

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

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

// 获取-工作经历
export const getResumeWorkExp = async () => {
  return await request.get({
    url: '/app-api/menduner/system/person/resume/get/work/exp'
  })
}

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

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

// 保存项目经历
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 await request.get({
    url: '/app-api/menduner/system/person/resume/get/project/exp'
  })
}

// 获取-技能树形
export const getSkillTree = async () => {
  return await request.get({
    url: '/app-api/menduner/system/skill/get/tree'
  })
}

// 获取-职业技能
export const getResumePersonSkill = async () => {
  return await request.get({
    url: '/app-api/menduner/system/person/resume/get/person/skill'
  })
}

// 删除-职业技能
export const deleteResumePersonSkill = async (id) => {
  return await request.delete({
    url: '/app-api/menduner/system/person/resume/person/skill/remove?id=' + id
  })
}

// 保存-职业技能
export const saveResumePersonSkill = async (data) => {
  return await request.post({
    url: '/app-api/menduner/system/person/resume/person/skill/save',
    data
  })
}

// 保存求职意向
export const saveResumeJobInterested = async (data) => {
  return await request.post({
    url: '/app-api/menduner/system/person/resume/job/interested/save',
    data
  })
}

// 删除求职意向
export const deleteResumeJobInterested = async (id) => {
  return await request.delete({
    url: '/app-api/menduner/system/person/resume/job/interested/remove?id=' + id
  })
}

// 获取求职意向
export const getResumeJobInterested = async () => {
  return await request.get({
    url: '/app-api/menduner/system/person/resume/get/job/interested'
  })
}

// 根据专业名称模糊搜索
export const schoolMajorByName = async (params) => {
  return await request.get({
    url: '/app-api/menduner/system/major/search/by/name',
    params
  })
}

// 根据学校名称模糊搜索
export const schoolSearchByName = async (params) => {
  return await request.get({
    url: '/app-api/menduner/system/school/search/by/name',
    params
  })
}

// 根据企业名称模糊搜索
export const enterpriseSearchByName = async (params) => {
  return await request.get({
    url: '/app-api/menduner/system/enterprise/search/by/name',
    params
  })
}

// 保存附件
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}`
  })
}