import request from '@/utils/request';

// 获取租户下的所有职位
export function getTenantPositions(tenantId) {
  return request({
    url: `/backend/positions/tenant/${tenantId}`,
    method: 'get',
  });
}

// 根据部门ID获取职位列表
export function getPositionsByDepartment(departmentId) {
  return request({
    url: `/backend/positions/department/${departmentId}`,
    method: 'get',
  });
}

// 获取职位详情
export function getPositionInfo(positionId) {
  return request({
    url: `/backend/positions/${positionId}`,
    method: 'get',
  });
}

// 添加职位
export function addPosition(data) {
  return request({
    url: '/backend/positions',
    method: 'post',
    data,
  });
}

// 更新职位信息
export function editPosition(positionId, data) {
  return request({
    url: `/backend/positions/${positionId}`,
    method: 'put',
    data,
  });
}

// 删除职位
export function deletePosition(positionId) {
  return request({
    url: `/backend/positions/${positionId}`,
    method: 'delete',
  });
}

