import request from '@/config/axios'

// 获取热门企业
export const getHotEnterprise = async (params) => {
  return await request.get({
    url: '/app-api/menduner/system/job/advertised/get/hot/enterprise',
    params
  })
}

// 企业详情
export const getEnterpriseDetails = async (params) => {
  return await request.get({
    url: '/app-api/menduner/system/enterprise/detail',
    params
  })
}

// 效验求职者是否关注该企业
export const getEnterpriseSubscribeCheck = async (params) => {
  return await request.get({
    url: '/app-api/menduner/system/person/enterprise/subscribe/check',
    params
  })
}

// 求职者关注企业
export const getEnterpriseSubscribe = async (data) => {
  return await request.post({
    url: '/app-api/menduner/system/person/enterprise/subscribe',
    data
  })
}

// 求职者取消关注企业
export const getEnterpriseUnsubscribe = async (enterpriseId) => {
  return await request.delete({
    url: `/app-api/menduner/system/person/enterprise/unsubscribe?enterpriseId=` + enterpriseId
  })
}

// 企业检索
export const getEnterpriseSearch = async (params) => {
  return await request.get({
    url: '/app-api/menduner/system/enterprise/search',
    params
  })
}

// 点击企业详情埋点
export const enterpriseClick = async (data) => {
  return await request.post({
    url: '/app-api/menduner/system/enterprise/click',
    data
  })
}

// 招聘端-牛人管理-列表
export const getPersonCvPage = async (params) => {
  return await request.get({
    url: '/app-admin-api/menduner/system/person-cv/page',
    params
  })
}

// 招聘端-牛人管理-获取发布的职位列表
export const getJobAdvertised = async (params) => {
  return await request.get({
    url: '/app-admin-api/menduner/system/job-advertised/list',
    params
  })
}

// 招聘端-保存用户基本信息
export const saveUserInfo = async (data) => {
  return await request.post({
    url: '/app-admin-api/menduner/system/user/save',
    data
  })
}

// 招聘端-获取人才的在线简历详情
export const getPersonCvDetail = async (userId, id) => {
  return await request.get({
    url: `/app-admin-api/menduner/system/person-cv/detail?userId=${userId}&id=${id}`
  })
}

// 招聘端-企业信息-获取基本信息
export const getEnterpriseBaseInfo = async () => {
  return await request.get({
    url: '/app-admin-api/menduner/system/enterprise/get'
  })
}

// 招聘端-企业信息-修改基本信息
export const updateEnterpriseBaseInfo = async (data) => {
  return await request.post({
    url: '/app-admin-api/menduner/system/enterprise/update',
    data
  })
}

// 招聘端-企业信息-修改企业相册
export const updateEnterpriseAlbum = async (data) => {
  return await request.post({
    url: '/app-admin-api/menduner/system/enterprise/album/update',
    data
  })
}

// 招聘端-企业信息-修改营业执照信息
export const updateEnterpriseBusiness = async (data) => {
  return await request.post({
    url: '/app-admin-api/menduner/system/enterprise/business/update',
    data
  })
}

// 招聘端-企业信息-获取营业执照信息
export const getEnterpriseBusiness = async (params) => {
  return await request.get({
    url: '/app-admin-api/menduner/system/enterprise/business/get',
    params
  })
}

// 招聘端-企业信息-修改企业logo
export const updateEnterpriseLogo = async (url) => {
  return await request.post({
    url: `/app-admin-api/menduner/system/enterprise/logo/update?logoUrl=${url}`
  })
}

// // 招聘端-企业信息-获取企业福利标签
// export const getEnterpriseWelfare = async (params) => {
//   return await request.get({
//     url: '/app-admin-api/menduner/system/enterprise/welfare/get',
//     params
//   })
// }

// 招聘端-企业信息-修改企业福利标签
export const updateEnterpriseWelfare = async (data) => {
  return await request.post({
    url: '/app-admin-api/menduner/system/enterprise/welfare/update',
    data
  })
}

// 招聘端-企业信息-修改企业标签
export const updateEnterpriseTag = async (data) => {
  return await request.post({
    url: '/app-admin-api/menduner/system/enterprise/tag/update',
    data
  })
}

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