import request from "@/utils/request"

// 获取人才信息信息
export const getBaseInfo = (params) => {
  return request({
    url: '/app-api/menduner/system/person/get',
    method: 'GET',
    params,
    custom: {
      openEncryption: true,
      showLoading: false,
      auth: true
    }
  })
}

// 获取用户信息
export const getUserInfo = (params) => {
  return request({
    url: '/app-api/menduner/system/recruit/user/get',
    method: 'GET',
    params,
    custom: {
      openEncryption: true,
      showLoading: false,
      auth: true
    }
  })
}

// 获取账户信息
export const getUserAccountInfo = () => {
  return request({
    url: '/app-api/pay/currency/get',
    method: 'GET',
    custom: {
      openEncryption: true,
      showLoading: false,
      auth: true
    }
  })
}

// 获取附件列表
export const getPersonResumeCv = () => {
  return request({
    url: '/app-api/menduner/system/person/resume/get/person/cv',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 附件简历解析2
export const resumeParser2 = (params) => {
  return request({
    url: '/admin-api/menduner/system/online/resume/parser2',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 简历解析-保存简历信息
export const saveResumeInfo = (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/save',
    method: 'POST',
    data,
    custom: {
      openEncryption: true,
      auth: true,
      showLoading: false
    }
  })
}

// 获取收藏的招聘职位列表
export const getJobFavoriteList = (params) => {
  return request({
    url: '/app-api/menduner/system/person/get/job/favorite/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取关注的企业列表
export const getSubscribeEnterprise = (params) => {
  return request({
    url: '/app-api/menduner/system/person/get/enterprise/subscribe/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 谁看过我
export const getInterestedMePage = (params) => {
  return request({
    url: '/app-api/menduner/system/job-cv-rel/look/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 众聘比例信息
export const getPublicRatio = () => {
  return request({
    url: '/admin-api/menduner/system/hire-commission-ratio/get',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 上传附件简历
export const saveResume = (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/person/cv/save',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 删除附件简历
export const deleteResume = (id) => {
  return request({
    url: '/app-api/menduner/system/person/resume/person/cv/remove',
    method: 'DELETE',
    params: {
      id
    },
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 获取已投递的职位列表
export const getJobDeliveryList = (params) => {
  return request({
    url: '/app-api/menduner/system/job-cv-rel/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取面试日程分页
export const getUserInterviewInvitePage = (params) => {
  return request({
    url: '/app-api/menduner/system/interview-invite/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 同意邀约面试
export const userInterviewInviteConsent = (data) => {
  return request({
    url: '/app-api/menduner/system/interview-invite/consent',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 拒绝邀约面试
export const userInterviewInviteReject = (id) => {
  return request({
    url: '/app-api/menduner/system/interview-invite/reject',
    method: 'POST',
    params: {
      id
    },
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 企业详情
export const getEnterpriseDetails = (id) => {
  return request({
    url: '/app-api/menduner/system/enterprise/detail',
    method: 'GET',
    params: {
      id
    },
    custom: {
      auth: false,
      showLoading: false
    }
  })
}

// 效验求职者是否关注该企业
export const getEnterpriseSubscribeCheck = (params) => {
  return request({
    url: '/app-api/menduner/system/person/enterprise/subscribe/check',
    method: 'GET',
    params,
    custom: {
      auth: false,
      showLoading: false
    }
  })
}

// 关注企业
export const getEnterpriseSubscribe = (data) => {
  return request({
    url: '/app-api/menduner/system/person/enterprise/subscribe',
    method: 'POST',
    data,
    custom: {
      auth: false,
      showLoading: false
    }
  })
}

// 取消关注企业
export const getEnterpriseUnsubscribe = (enterpriseId) => {
  return request({
    url: '/app-api/menduner/system/person/enterprise/unsubscribe',
    method: 'DELETE',
    params: {
      enterpriseId
    },
    custom: {
      auth: false,
      showLoading: false
    }
  })
}

// 点击企业详情埋点
export const enterpriseClick = (data) => {
  return request({
    url: '/app-api/menduner/system/enterprise/click',
    method: 'POST',
    data,
    custom: {
      auth: false,
      showLoading: false
    }
  })
}

// 获取企业实名认证信息
export const getEnterpriseAuthDetails = (enterpriseId) => {
  return request({
    url: '/app-api/menduner/system/enterprise/get/auth',
    method: 'GET',
    params: {
      enterpriseId
    },
    custom: {
      auth: false,
      showLoading: false
    }
  })
}

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

// 根据类型获取标签信息
export const getTagTreeDataApi = async (params) => {
  return request({
    url: '/admin-api/menduner/system/tag/get/by/type',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 修改个人画像
export const savePersonPortrait = (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/tag/update',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 保存个人优势
export const saveResumeAdvantage = (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/advantage/save',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 修改头像
export const updatePersonAvatar = (avatar) => {
  return request({
    url: '/app-api/menduner/system/person/resume/avatar/update',
    method: 'POST',
    params: {
      avatar
    },
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 获取职位分享小程序二维码
export const getJobAdvertisedShareQrcode = (data, custom) => {
  return request({
    url: '/app-api/menduner/system/social-user/wxa-qrcode',
    method: 'POST',
    data,
    custom: {
      auth: custom?.noAuth ? false : true,
      showLoading: false
    }
  })
}

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

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

// 获取学生基本信息
export const getStudentInfo = (data) => {
  return request({
    url: '/app-api/menduner/system/person/resume/student/get',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}
