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

/**
 * @description: 部门列表
 */
export function getDeptList(params?) {
  return http.request({
    url: '/dept/list',
    method: 'GET',
    params,
  });
}

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

/**
 * @description: 添加部门
 */
export function deptAdd(data: any) {
  return http.request({
    url: '/dept/add',
    method: 'POST',
    data,
  });
}

/**
 * @description: 更新部门
 */
export function deptUpdate(data: any) {
  return http.request({
    url: '/dept/update',
    method: 'PUT',
    data,
  });
}

/**
 * @description: 删除部门
 */
export function deptDelete(deptId) {
  return http.request({
    url: '/dept/delete/' + deptId,
    method: 'DELETE',
  });
}
