import request from '@/config/axios'

// 岗位列表分页
export const getEnterprisePostPage = async (params) => {
  return await request.get({
    url: '/app-admin-api/menduner/system/enterprise-post/page',
    params
  })
}

// 岗位详情
export const getEnterprisePostDetail = async (id) => {
  return await request.get({
    url: `/app-admin-api/menduner/system/enterprise-post/get?id=${id}`
  })
}

// 岗位新增
export const createEnterprisePost = async (data) => {
  return await request.post({
    url: '/app-admin-api/menduner/system/enterprise-post/create',
    data
  })
}

// 岗位更新
export const updateEnterprisePost = async (data) => {
  return await request.put({
    url: '/app-admin-api/menduner/system/enterprise-post/update',
    data
  })
}

// 岗位删除
export const deleteEnterprisePost = async (id) => {
  return await request.delete({
    url: `/app-admin-api/menduner/system/enterprise-post/delete?id=${id}`
  })
}

// 效验岗位下是否绑定用户
export const checkPost = async (postId) => {
  return await request.get({
    url: `/app-admin-api/menduner/system/user/check/post?postId=${postId}`
  })
}