import request from '@/utils/request';

// 获取租户下的所有部门
export function getTenantDepartments(tenantId) {
  return request({
    url: `/backend/departments/tenant/${tenantId}`,
    method: 'get',
  });
}

// 获取部门详情
export function getDepartmentInfo(departmentId) {
  return request({
    url: `/backend/departments/${departmentId}`,
    method: 'get',
  });
}

// 添加部门
export function addDepartment(data) {
  return request({
    url: '/backend/departments',
    method: 'post',
    data,
  });
}

// 更新部门信息
export function editDepartment(departmentId, data) {
  return request({
    url: `/backend/departments/${departmentId}`,
    method: 'put',
    data,
  });
}

// 删除部门
export function deleteDepartment(departmentId) {
  return request({
    url: `/backend/departments/${departmentId}`,
    method: 'delete',
  });
}

