import request from "@/utils/request"

// 获得招聘会列表
export const getJobFairList = () => {
  return request({
    url: '/app-api/menduner/system/recruit/job-fair/list',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 效验是否有权限参加招聘会
export const checkJobFairPermission = (jobFairId) => {
  return request({
    url: '/app-api/menduner/system/recruit/job-fair/check/permission',
    method: 'GET',
    params: { jobFairId },
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获得招聘会-招聘会详情
export const getJobFair = (id) => {
  return request({
    url: '/app-api/menduner/system/recruit/job-fair/get',
    method: 'GET',
    params: { id },
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 招聘会企业分页查询
export const getJobFairEnterprisePage = (params) => {
  return request({
    url: '/app-api/menduner/system/job-fair/enterprise/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 查询企业招聘会职位列表
export const getJobFairPosition = (id) => {
  return request({
    url: '/app-api/menduner/system/recruit/job-fair/get/by/job-fair',
    method: 'GET',
    params: { id },
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 企业将职位移除招聘会
export const quitJobFairPosition = (data) => {
  return request({
    url: '/app-api/menduner/system/recruit/job-fair/quit',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 企业将职位加入招聘会
export const joinJobFairPosition = (data) => {
  return request({
    url: '/app-api/menduner/system/recruit/job-fair/join',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 保存分享参数
export const saveShareQuery = (data) => {
  return request({
    url: '/app-api/menduner/system/share/share',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 根据id获取分享参数
export const getShareQueryById = (params) => {
  return request({
    url: '/app-api/menduner/system/share/get',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 根据招聘会id获取未加入招聘会的职位列表
export const getJobFairPositionList = (params) => {
  return request({
    url: '/app-api/menduner/system/recruit/job-fair/get/not-joined-job/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}
