import { http } from '@/utils/http/axios';

/**
 * @description: 岗位列表
 */
export function getPositionList(params?) {
  return http.request({
    url: '/position/page',
    method: 'GET',
    params,
  });
}

/**
 * 获取全部岗位列表
 * @param params 参数
 * @returns 返回结果
 */
export function getPositionAllList(params?) {
  return http.request({
    url: '/position/list',
    method: 'GET',
    params,
  });
}

/**
 * @description: 根据ID获取详情
 */
export function getPositionDetail(positionId) {
  return http.request({
    url: '/position/detail/' + positionId,
    method: 'get',
  });
}

/**
 * @description: 添加岗位
 */
export function positionAdd(data: any) {
  return http.request({
    url: '/position/add',
    method: 'POST',
    data,
  });
}

/**
 * @description: 更新岗位
 */
export function positionUpdate(data: any) {
  return http.request({
    url: '/position/update',
    method: 'PUT',
    data,
  });
}

/**
 * @description: 删除岗位
 */
export function positionDelete(positionId) {
  return http.request({
    url: '/position/delete/' + positionId,
    method: 'DELETE',
  });
}

/**
 * @description: 批量删除岗位
 */
export function positionBatchDelete(data: any) {
  return http.request({
    url: '/position/batchDelete',
    method: 'DELETE',
    data,
  });
}
