import request from "@/utils/request"

// 获取精选企业列表
export const getHotEnterprise = (params) => {
  return request({
    url: '/app-api/menduner/system/job/advertised/get/hot/enterprise',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 更新员工信息
export const updateStaffInfo = (data) => {
  return request({
    url: '/app-api/menduner/system/recruit/user/save',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取企业基本信息
export const getEnterpriseInfo = () => {
  return request({
    url: '/app-api/menduner/system/recruit/enterprise/get',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 更新企业基本信息
export const updateEnterpriseInfo = (data) => {
  return request({
    url: '/app-api/menduner/system/recruit/enterprise/update',
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 更新企业LOGO
export const updateEnterpriseLogo = (url) => {
  return request({
    url: `/app-api/menduner/system/recruit/enterprise/logo/update?logoUrl=${url}`,
    method: 'POST',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取人才的在线简历详情
export const getPersonCvDetail = (userId) => {
  return request({
    url: '/app-api/menduner/system/recruit/person-cv/detail?userId=' + userId,
    method: 'GET',
    custom: {
      openEncryption: true,
      showLoading: false,
      auth: false
    }
  })
}

// 企业注册
export const enterpriseRegisterApply = (data) => {
  return request({
    url: `/app-api/menduner/system/enterprise-register/apply`,
    method: 'POST',
    data,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取当前用户提交的企业申请
export const getUserRegisterEnterpriseApply = () => {
  return request({
    url: '/app-api/menduner/system/enterprise-register/by/user',
    method: 'GET',
    custom: {
      openEncryption: true,
      showLoading: false,
      auth: false
    }
  })
}

// 根据邮箱获取企业注册申请
export const getEnterpriseRegisterApply = (email) => {
  return request({
    url: '/app-api/menduner/system/enterprise-register/by/email?email=' + email,
    method: 'GET',
    custom: {
      openEncryption: true,
      showLoading: false,
      auth: false
    }
  })
}