import request from "@/utils/request"

// 根据条件搜索招聘职位
export const getJobAdvertisedSearch = (params) => {
  return request({
    url: '/app-api/menduner/system/job/advertised/search',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 推荐职位列表
export const getPromotedPosition = (params) => {
  return request({
    url: '/app-api/menduner/system/job/advertised/get/recommended',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 职位详情
export const getPositionDetails = (params) => {
  return request({
    url: '/app-api/menduner/system/job/advertised/get/detail',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 效验招聘职位是否投递
export const jobCvRelCheckSend = (params) => {
  return request({
    url: '/app-api/menduner/system/job-cv-rel/send/check',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 效验“招聘会”职位是否投递
export const jobFairCvRelCheckSend = (params) => {
  return request({
    url: '/app-api/menduner/system/job-cv-rel/job-fair/send/check',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 效验求职者是否收藏该职位
export const getJobFavoriteCheck = (params) => {
  return request({
    url: '/app-api/menduner/system/person/job/favorite/check',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 求职者收藏职位
export const getPersonJobFavorite = (data) => {
  return request({
    url: '/app-api/menduner/system/person/job/favorite',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 求职者取消收藏职位
export const getPersonJobUnfavorite = (jobId) => {
  return request({
    url: `/app-api/menduner/system/person/job/unfavorite?jobId=` + jobId,
    method: 'DELETE',
    // params: {
    //   jobId
    // },
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 投递简历
export const jobCvRelSend = (data) => {
  return request({
    url: '/app-api/menduner/system/job-cv-rel/send',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 众聘分享-投递简历
export const jobCvRelHireSend = (data) => {
  return request({
    url: '/app-api/menduner/system/job-cv-rel/hire/recommend/send',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}

// 获取众聘职位分页
export const getJobAdvertisedHire = (params) => {
  return request({
    url: '/app-api/menduner/system/job/advertised/get/hire',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 获取统计信息
export const getRecommendCount = (params) => {
  return request({
    url: '/app-api/menduner/system/job-cv-rel/hire/get/recommend/count',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 二维码拉新记录
export const getInviteRecord = (params) => {
  return request({
    url: '/app-api/menduner/system/person/get/invite/person/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取统计信息
export const getRecommendationList = (params) => {
  return request({
    url: '/app-api/menduner/system/job-cv-rel/hire/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 根据id查询分享的职位id与推荐人id
export const getShareDetail = (params) => {
  return request({
    url: '/app-api/menduner/system/job/advertised/get/share',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 职位详情-获取相似职位
export const getSimilarPosition = (params) => {
  return request({
    url: '/app-api/menduner/system/job/advertised/get/acquainted',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}
